Alal
2011-Apr-12 11:32 UTC
[R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)
Hello Im struggling on something... I have one continuous variable (A), and I need to explain it with 4 factors, and maybe one continuous covariate. And of course, my variable A is not normal at all (it's a duration in seconds, whole numbers). What can I do? I would know how do deal with it if I had one factor, maybe two, but in that case Im really not sure what I am supposed to do to write a model that is statistically correct. Thanks, Al -- View this message in context: http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covariate-with-interactions-tp3444378p3444378.html Sent from the R help mailing list archive at Nabble.com.
Dr. Pablo E. Verde
2011-Apr-12 13:01 UTC
[R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)
> > Im struggling on something... I have one continuous variable (A), and I > need > to explain it with 4 factors, and maybe one continuous covariate. > And of course, my variable A is not normal at all (it's a duration in > seconds, whole numbers). > > What can I do? I would know how do deal with it if I had one factor, maybe > two, but in that case Im really not sure what I am supposed to do to write > a > model that is statistically correct.If you are working with a positive outcome variable, one approach is to use glm( ..., family ="Gamma"), other approach is to use survreg() in the package survival. Cheers, Pablo> > Thanks, > > Al > > -- > View this message in context: > http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covariate-with-interactions-tp3444378p3444378.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >
Alal
2011-Apr-12 13:42 UTC
[R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)
Thanks Im not sure about the gamma, but a survival analysis seems appropriate, but does it work for factors and continuous covariates? Do you have to verify some conditions beforehand? -- View this message in context: http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covariate-with-interactions-tp3444378p3444670.html Sent from the R help mailing list archive at Nabble.com.
PabloEmilio.Verde at uni-duesseldorf.de
2011-Apr-12 20:10 UTC
[R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)
Zitat von Alal <bohk at voila.fr>:> Thanks > > Im not sure about the gamma, but a survival analysis seems appropriate, but > does it work for factors and continuous covariates? Do you have to verify > some conditions beforehand?Here is an example: # test data... library(survival) set.seed(1007) x <- runif(50) mu <- c(rep(1, 25), rep(2, 25)) test1 <- data.frame(Time = qsurvreg(x, mean = mu, scale= 0.5, distribution "weibull"), Status = rbinom(50,1,0.7), f1 = gl(2, 25), f2 = factor(rbinom(50, 1, 0.5)), f3 = factor(rbinom(50, 1, 0.5)), f4 = factor(rbinom(50, 1, 0.5)), z = rnorm(50) ) mod1 <- survreg(Surv(Time, Status) ~ f1*(f2 + f2 + f4) + z, data = test1) summary(mod1) Cheers, Pablo> > -- > View this message in context: > http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covariate-with-interactions-tp3444378p3444670.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >
Alal
2011-Apr-13 10:34 UTC
[R] 1 continuous non-normal variable ~ 4 factors + 1 continuous covariate (with interactions)
Thanks, I guess I can do that, and it actually seem appropriate for one of my variable. But can you do post-hoc tests on a survival analysis? Use contrasts or something? -- View this message in context: http://r.789695.n4.nabble.com/1-continuous-non-normal-variable-4-factors-1-continuous-covariate-with-interactions-tp3444378p3446782.html Sent from the R help mailing list archive at Nabble.com.