Dear R-help list,

 

I have grouped data, looking like this:

 

cases <- c(23,12,56,81)

total <- c(123,234,248,390)

x1 <- c(0,0,1,1)

x2 <- c(0,1,0,1)

 

Data <- as.data.frame(cbind(cases,total,x1,x2))

Data

 

I would like to run a logistic regression with group weights on these,
where cases and (total-cases) are equal to the group weights (w).

 

My final data would look like:

 

w <- c(100,23,222,12,192,56,309,81)

y <- c(0,1,0,1,0,1,0,1)

x1 <- c(0,0,0,0,1,1,1,1)

x2 <- c(0,0,1,1,0,0,1,1)

 

Data.long <- as.data.frame(cbind(w,y,x1,x2))

Data.long

 

Any suggestions?

 

All the best,

Oystein Myrland


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to