Re: [R] Confidence Interval for p1-p2 and plot the CI with bar chart

2021-11-13 Thread Jim Lemon
Hi Abou, Perhaps this will be helpful. Be aware that you will cop some flak for putting error bars on a bar plot. aadat<-data.frame(group=c(rep("Exp",50),rep("Con",50)), v1=sample(0:1,100,TRUE), v2=sample(0:1,100,TRUE), v3=sample(0:1,100,TRUE), v4=sample(0:1,100,TRUE), v5=sample(0:1,100,TRUE)

[R] Confidence Interval for p1-p2 and plot the CI with bar chart

2021-11-13 Thread AbouEl-Makarim Aboueissa
Dear All: I do have a binary data set with multiple variables, event = 1 in all variables. As an example, I attached a data set with 6 variables. The first column is the grouping variable. Then the next 5 columns are the binary data for 5 variables. - Can we compute the confidence interval fo

Re: [R] Using update() within a function with a changed formula

2021-11-13 Thread Wolfgang Viechtbauer
Perfectly clear. Thanks! Best, Wolfgang On Sat, 13 Nov 2021, Duncan Murdoch wrote: On 13/11/2021 2:24 p.m., Viechtbauer, Wolfgang (SP) wrote: Hello all, Say I would like to change the outcome in a formula to a variable not part of the original dataset. This works just fine: res <- lm(mpg ~

Re: [R] Using update() within a function with a changed formula

2021-11-13 Thread Duncan Murdoch
On 13/11/2021 2:24 p.m., Viechtbauer, Wolfgang (SP) wrote: Hello all, Say I would like to change the outcome in a formula to a variable not part of the original dataset. This works just fine: res <- lm(mpg ~ wt + cyl, data=mtcars) res y <- rnorm(nobs(x)) update(x, formula = y ~ .) But not whe

[R] Using update() within a function with a changed formula

2021-11-13 Thread Viechtbauer, Wolfgang (SP)
Hello all, Say I would like to change the outcome in a formula to a variable not part of the original dataset. This works just fine: res <- lm(mpg ~ wt + cyl, data=mtcars) res y <- rnorm(nobs(x)) update(x, formula = y ~ .) But not when doing so within a function: rm(y) f <- function(x) { y