Hi all: I am a user of "JM" package. Here's the problem of "sample size". The warning is: Error in jointModel(fitLME, fitSURV_death, timeVar = "time", method = "piecewise-PH-GH") : sample sizes in the longitudinal and event processes differ. According to the suggestion of "missing data",I use the same data set(data_JM) without any missing value. fitLME <- lme(CD4 ~ time + time:Group_DR, random = ~time | id,data = data_JM); fitSURV_death <- coxph(Surv(time_fail, death) ~ (Group_DR), data = data_JM, x = TRUE); summary(fitLME); Linear mixed-effects model fit by REML Data: data_JM AIC BIC logLik 9102.502 9134.538 -4544.251 ... ... Number of Observations: 721 summary(fitSURV_death) Call: coxph(formula = Surv(time_fail_min, death) ~ (Group_DR), data = data_JM, x = TRUE) n= 721 coef exp(coef) se(coef) z Pr(>|z|) Group_DR -0.16854 0.84490 0.04213 -4 6.33e-05 *** --- Signif. codes: 0 ¡®***¡¯ 0.001 ¡®**¡¯ 0.01 ¡®*¡¯ 0.05 ¡®.¡¯ 0.1 ¡® ¡¯ 1 The sample size of lme and coxph is the same as marked blue above,and I'm sure that data_JM contains no missing value. So, what's reason about the warning "Error in jointModel(fitLME, fitSURV_death, timeVar = "time", method = "piecewise-PH-GH") : sample sizes in the longitudinal and event processes differ." Thanks a lot . My best. [[alternative HTML version deleted]]
Hi, there, I run into the same sample size error in JM. Have you found the solution for the error? Many thanks, Helena -- View this message in context: http://r.789695.n4.nabble.com/the-problem-about-sample-size-tp1592855p4434009.html Sent from the R help mailing list archive at Nabble.com.
Hi> > Hi, there, > > I run into the same sample size error in JM. Have you found the solutionfor> the error?What error? Petr> > Many thanks, > Helena > > -- > View this message in context: http://r.789695.n4.nabble.com/the-problem- > about-sample-size-tp1592855p4434009.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 guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Hi I am not at all an expert in this matter, so you shall copy you message to r-help list too. However I would try na.action=na.exclude as it shall preserve the length of variables. Regards Petr> > Hi, > > Sorry I didn't know the original post in this thread was not included.I'm> using R version 2.14.0 (2011-10-31). > > This is the program: > > fitLME4 <- lme(iadl ~ obstime, > random = ~ obstime | id, data = iadl.long.df, na.action=na.omit) > fitSURV <- coxph(Surv(Time, death) ~ agew1, data = last_aa.df, x = TRUE)> fit.JM4 <- jointModel(fitLME1, fitSURV, timeVar = "obstime", method = > "piecewise-PH-GH") > > This is the error message: > > Error in jointModel(fitLME1, fitSURV, timeVar = "obstime", method = > "piecewise-PH-GH") : > sample sizes in the longitudinal and event processes differ; maybe you> forgot the cluster() argument. > > I have missing data in the lme data and that's why I used na.omit. But > results of the lme and coxph show the same number of participants. > > From lme: > Number of Observations: 4818 > Number of Groups: 2087 > > From coxph: > n= 2087, number of events= 1721 > > If the number of groups in lme = n in coxph, why am I getting the error > message that sample sizes differ? > > Many thanks for your help. > > Helena > > ________________________________________ > From: Petr PIKAL [petr.pikal at precheza.cz] > Sent: Thursday, March 01, 2012 6:17 PM > To: Helena Chui > Cc: r-help at r-project.org; r-help-bounces at r-project.org > Subject: Re: [R] the problem about sample size > > Hi > > > > Hi, there, > > > > I run into the same sample size error in JM. Have you found thesolution> for > > the error? > > What error? > Petr > > > > > Many thanks, > > Helena > > > > -- > > View this message in context:http://r.789695.n4.nabble.com/the-problem-> > about-sample-size-tp1592855p4434009.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.