-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
90 lines (90 loc) · 3.37 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
crs_robust_test(rxmo=0.180773,rxy=0.160263,rymo=0.4465,nobs=123,alpha=0.1)
getwd()
setwd("C:/Users/user/Dropbox (Personal)/Sensitivity analysis of Mediation/R package/ConMed")
devtools::check()
devtools::install()
library(shiny)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
numericInput(inputId = "rxmo",
label = "Correlation between X and Mo",
value = 0.1807, min = 0, max = 1, step = 0.01),
numericInput(inputId = "rxy",
label = "Correlation between X and Y",
value = 0.1602, min = 0, max = 1, step = 0.01),
numericInput(inputId = "rymo",
label = "Correlation between Y and Mo",
value = 0.446, min = 0, max = 1, step = 0.01),
numericInput(inputId = "nobs",
label = "Number of Observations",
value = 123, min = 1, max = NA, step = 1),
numericInput(inputId = "conflevel",
label = "Confidence Interval",
value = 0.95, min = 0.01, max = 0.99, step = 0.01),
radioButtons(inputId ="labelest",
label = "Parameter of interest",
choices = c("a1","b1", "c","a1b1", "a1,b1, and a1b1"))),
mainPanel(plotOutput("plot", width = "100%"))
)
)
server <- function(input, output){
output$plot <- renderPlot(
{if (input$labelest=="a1,b1, and a1b1")
{rxmu_plot_a1b1(input$rxmo, input$rxy, input$rymo, input$nobs,
input$conflevel, specifyunob = 0)}
else {rxmu_plot(input$rxmo, input$rxy, input$rymo, input$nobs,input$labelest,
input$conflevel, specifyunob = 0)}}, width = 600, height = 800)
}
shinyApp(ui = ui, server = server)
devtools::check()
devtools::install()
library(ConMed)
conmed_plot_a1b1(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123)
devtools::install()
library(ConMed)
conmed_plot_a1b1(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123)
conmed_plot_a1b1(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123)
rxmuplot<- rxmu_plot_a1b1(rxmo,rxy,rymo,nobs, conflevel, specifyunob = 0)
rxmo=0.1807
rxy=0.1602
rymo=0.446
nobs=123
rxmuplot<- rxmu_plot_a1b1(rxmo,rxy,rymo,nobs, conflevel, specifyunob = 0)
conflevel = 0.95
rxmuplot<- rxmu_plot_a1b1(rxmo,rxy,rymo,nobs, conflevel, specifyunob = 0)
rmomuplot <- rmomu_plot_a1b1(rxmo,rxy,rymo,nobs, conflevel,specifyunob = 0)
rymuplot <- rymu_plot_a1b1(rxmo,rxy,rymo,nobs, conflevel,specifyunob = 0)
grid.draw(rbind(ggplotGrob(rxmuplot), ggplotGrob(rymuplot), size = "last"))
install.packages("grid")
install.packages("grid")
install.packages("grid")
library(gri)d
install.packages("grid")
library(grid)
grid.draw(rbind(ggplotGrob(rxmuplot), ggplotGrob(rymuplot), size = "last"))
library(ggplot2)
grid.draw(rbind(ggplotGrob(rxmuplot), ggplotGrob(rymuplot), size = "last"))
rxmuplot
rxmuplot
rxmu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "a1", conflevel=0.95,specifyunob = 1,rmomu=0.4,rymu=0.3)
library(ConMed)
rxmu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "a1", conflevel=0.95)
devtools::install()
library(ConMed)
rxmu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "a1", conflevel=0.95)
devtools::install()
library(ConMed)
conmed_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123)
p3<- rymu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "a1b1", conflevel=0.95,specifyunob = 0)
p3
rymu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "indirect1", conflevel=0.95,specifyunob = 1, rxmu=0.1, rmomu = 0.1)
rxmu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "a1b1", conflevel=0.95,specifyunob = 1,rmomu=0.4,rymu=0.3)
rmomu_plot(rxmo=0.1807,rxy=0.1602,rymo=0.446,nobs=123,
labelest = "indirect1", conflevel=0.95,specifyunob = 1, rxmu=0.2,rymu = 0.2)