R: what is 'adjusted by' in survival analysis? - r

male_data:
surgery age cancer survival
a00001 yes <=50 0 10
a00002 yes >50 1 15
a00003 no >50 0 2
.
.
.
.
Result:
Call:
coxph(formula = Surv(survival, cancer) ~ surgery + age, data = male_data)
n= 550517, number of events= 3276
coef exp(coef) se(coef) z Pr(>|z|)
surgery:yes -0.03 0.97 0.04 -0.88 0.377
age:>50 3.26 26.09 0.04 78.5 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(coef) exp(-coef) lower .95 upper .95
surgery:yes 0.97 1.03 0.9 1.04
age:>50 26.09 0.04 24.05 28.3
Concordance= 0.817 (se = 0.005 )
Likelihood ratio test= 7607 on 2 df, p=<2e-16
Wald test = 6182 on 2 df, p=<2e-16
Score (logrank) test = 13993 on 2 df, p=<2e-16
Now I need to fill the result in a new form. But I do not know what "adjusted by" means. Can I find this value in the result? I would appreciate any advice!

In any observational study, you need to define clearly your exposure and outcome of interest. It seems that your exposure of interest is whether the patient had surgery or not and the outcome either the incidence of cancer or death from cancer. If this is the case, your results are adjusted by age.
You are the only person who can answer this question! It truly depends on the research question and the underlying causal structure you are thinking about.

Related

How can I change coef to exp(coef) in modelsummary table?

I am trying to create a summary table for my Cox model. However, when I use modelsummary function, it gives me a table that shows coef. But I want to display exp(coef) on my summary table. How can I change coef to exp(coef)?
I use this script to create a summary table:
modelsummary(model.1,
statistic='({conf.low}, {conf.high})',
stars=TRUE,
vcov = 'classical',
coef_omit = "Intercept",
coef_rename=c('ln_reb_capacity'='Relative rebel strength',
'terrcont'='Rebel territorial control', 'gdp'='Economic strength',
'bdbest'='Conflict intensity', 'roughterrain'='Rough terrain',
'loot'='Lootable resources', 'in_tpop'='Population size',
'powersharing'='Sharing Leadership'),
title = 'Table I.',
output='gt'
)
This is the summary table:
Table I.
─────────────────────────────────────────────────────────
Model 1
─────────────────────────────────────────────────────────
Relative rebel strength 0.125*
(0.016, 0.235)
Rebel territorial control -0.295+
(-0.638, 0.048)
Economic strength 0.000
(0.000, 0.000)
Conflict intensity 0.000
(0.000, 0.000)
Rough terrain 0.098
(-0.210, 0.405)
Lootable resources 0.105
(-0.298, 0.507)
Population size -0.119+
(-0.249, 0.011)
Sharing Leadership 0.046
(-0.393, 0.486)
─────────────────────────────────────────────────────────
Num.Obs. 260
AIC 1678.5
BIC 1707.0
RMSE 0.83
Std.Errors Classical
─────────────────────────────────────────────────────────
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
─────────────────────────────────────────────────────────
Column names: , Model 1
Here is my result for Cox model:
Call:
coxph(formula = Surv(month_duration, EndConflict) ~ ln_reb_capacity +
terrcont + gdp + bdbest + roughterrain + loot + in_tpop +
powersharing, data = df)
n= 260, number of events= 183
(108 observations deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
ln_reb_capacity 0.125154562 1.133323609 0.055831926 2.242 0.0250 *
terrcont -0.295113621 0.744446997 0.174927860 -1.687 0.0916 .
gdp -0.000004416 0.999995584 0.000017623 -0.251 0.8021
bdbest -0.000010721 0.999989279 0.000016057 -0.668 0.5043
roughterrain 0.097602616 1.102524573 0.156809154 0.622 0.5337
loot 0.104686159 1.110362079 0.205406301 0.510 0.6103
in_tpop -0.119020975 0.887789179 0.066355450 -1.794 0.0729 .
powersharing 0.046026931 1.047102610 0.224229347 0.205 0.8374
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
ln_reb_capacity 1.1333 0.8824 1.0159 1.264
terrcont 0.7444 1.3433 0.5284 1.049
gdp 1.0000 1.0000 1.0000 1.000
bdbest 1.0000 1.0000 1.0000 1.000
roughterrain 1.1025 0.9070 0.8108 1.499
loot 1.1104 0.9006 0.7424 1.661
in_tpop 0.8878 1.1264 0.7795 1.011
powersharing 1.0471 0.9550 0.6747 1.625
Concordance= 0.617 (se = 0.023 )
Likelihood ratio test= 18.96 on 8 df, p=0.02
Wald test = 18.2 on 8 df, p=0.02
Score (logrank) test = 18.36 on 8 df, p=0.02
Thanks.
You could adjust the argument exponentiate. If it's TRUE, the estimate, conf.low, and conf.high statistics are exponentiated, and the std.error is transformed to exp(estimate)*std.error
(by the delta method).
modelsummary(model.1,
...,
exponentiate = TRUE
)

Linear mixed model confidence intervals question

Hoping that you can clear some confusion in my head.
Linear mixed model is constructed with lmerTest:
MODEL <- lmer(Ca content ~ SYSTEM +(1 | YEAR/replicate) +
(1 | YEAR:SYSTEM), data = IOSDV1)
Fun starts happening when I'm trying to get the confidence intervals for the specific levels of the main effect.
Commands emmeans and lsmeans produce the same intervals (example; SYSTEM A3: 23.9-128.9, mean 76.4, SE:8.96).
However, the command as.data.frame(effect("SYSTEM", MODEL)) produces different, narrower confidence intervals (example; SYSTEM A3: 58.0-94.9, mean 76.4, SE:8.96).
What am I missing and what number should I report?
To summarize, for the content of Ca, i have 6 total measurements per treatment (three per year, each from different replication). I will leave the names in the code in my language, as used. Idea is to test if certain production practices affect the content of specific minerals in the grains. Random effects without residual variance were left in the model for this example.
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: CA ~ SISTEM + (1 | LETO/ponovitev) + (1 | LETO:SISTEM)
Data: IOSDV1
REML criterion at convergence: 202.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.60767 -0.74339 0.04665 0.73152 1.50519
Random effects:
Groups Name Variance Std.Dev.
LETO:SISTEM (Intercept) 0.0 0.0
ponovitev:LETO (Intercept) 0.0 0.0
LETO (Intercept) 120.9 11.0
Residual 118.7 10.9
Number of obs: 30, groups: LETO:SISTEM, 10; ponovitev:LETO, 8; LETO, 2
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 76.417 8.959 1.548 8.530 0.0276 *
SISTEM[T.C0] -5.183 6.291 24.000 -0.824 0.4181
SISTEM[T.C110] -13.433 6.291 24.000 -2.135 0.0431 *
SISTEM[T.C165] -7.617 6.291 24.000 -1.211 0.2378
SISTEM[T.C55] -10.883 6.291 24.000 -1.730 0.0965 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) SISTEM[T.C0 SISTEM[T.C11 SISTEM[T.C16
SISTEM[T.C0 -0.351
SISTEM[T.C11 -0.351 0.500
SISTEM[T.C16 -0.351 0.500 0.500
SISTEM[T.C5 -0.351 0.500 0.500 0.500
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see ?isSingular
> ls_means(MODEL, ddf="Kenward-Roger")
Least Squares Means table:
Estimate Std. Error df t value lower upper Pr(>|t|)
SISTEMA3 76.4167 8.9586 1.5 8.5299 23.9091 128.9243 0.02853 *
SISTEMC0 71.2333 8.9586 1.5 7.9514 18.7257 123.7409 0.03171 *
SISTEMC110 62.9833 8.9586 1.5 7.0305 10.4757 115.4909 0.03813 *
SISTEMC165 68.8000 8.9586 1.5 7.6797 16.2924 121.3076 0.03341 *
SISTEMC55 65.5333 8.9586 1.5 7.3151 13.0257 118.0409 0.03594 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Confidence level: 95%
Degrees of freedom method: Kenward-Roger
> emmeans(MODEL, spec = c("SISTEM"))
SISTEM emmean SE df lower.CL upper.CL
A3 76.4 8.96 1.53 23.9 129
C0 71.2 8.96 1.53 18.7 124
C110 63.0 8.96 1.53 10.5 115
C165 68.8 8.96 1.53 16.3 121
C55 65.5 8.96 1.53 13.0 118
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95
> as.data.frame(effect("SISTEM", MODEL))
SISTEM fit se lower upper
1 A3 76.41667 8.958643 57.96600 94.86734
2 C0 71.23333 8.958643 52.78266 89.68400
3 C110 62.98333 8.958643 44.53266 81.43400
4 C165 68.80000 8.958643 50.34933 87.25067
5 C55 65.53333 8.958643 47.08266 83.98400
Many thanks.
I'm pretty sure this has to do with the dreaded "denominator degrees of freedom" question, i.e. what kind (if any) of finite-sample correction is being employed. tl;dr emmeans is using a Kenward-Roger correction, which is more or less the most accurate available option — the only reason not to use K-R is if you have a large data set for which it becomes unbearably slow.
load packages, simulate data, fit model
library(lmerTest)
library(emmeans)
library(effects)
dd <- expand.grid(f=factor(letters[1:3]),g=factor(1:20),rep=1:10)
set.seed(101)
dd$y <- simulate(~f+(1|g), newdata=dd, newparams=list(beta=rep(1,3),theta=1,sigma=1))[[1]]
m <- lmer(y~f+(1|g), data=dd)
compare default emmeans with effects
emmeans(m, ~f)
## f emmean SE df lower.CL upper.CL
## a 0.848 0.212 21.9 0.409 1.29
## b 1.853 0.212 21.9 1.414 2.29
## c 1.863 0.212 21.9 1.424 2.30
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
as.data.frame(effect("f",m))
## f fit se lower upper
## 1 a 0.8480161 0.2117093 0.4322306 1.263802
## 2 b 1.8531805 0.2117093 1.4373950 2.268966
## 3 c 1.8632228 0.2117093 1.4474373 2.279008
effects doesn't explicitly tell us what/whether it's using a finite-sample correction: we could dig around in the documentation or the code to try to find out. Alternatively, we can tell emmeans not to use finite-sample correction:
emmeans(m, ~f, lmer.df="asymptotic")
## f emmean SE df asymp.LCL asymp.UCL
## a 0.848 0.212 Inf 0.433 1.26
## b 1.853 0.212 Inf 1.438 2.27
## c 1.863 0.212 Inf 1.448 2.28
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
Testing shows that these are equivalent to about a tolerance of 0.001 (probably close enough). In principle we should be able to specify KR=TRUE to get effects to use Kenward-Roger correction, but I haven't been able to get that to work yet.
However, I will also say that there's something a little bit funky about your example. If we compute the distance between the mean and the lower CI in units of standard error, for emmeans we get (76.4-23.9)/8.96 = 5.86, which implies a very small effect degrees of freedom (e.g. about 1.55). That seems questionable to me unless your data set is extremely small ...
From your updated post, it appears that Kenward-Roger is indeed estimating only 1.5 denominator df.
In general it is dicey/not recommended to try fitting random effects where the grouping variable has a small number of levels (although see here for a counterargument). I would try treating LETO (which has only two levels) as a fixed effect, i.e.
CA ~ SISTEM + LETO + (1 | LETO:ponovitev) + (1 | LETO:SISTEM)
and see if that helps. (I would expect you would then get on the order of 7 df, which would make your CIs ± 2.4 SE instead of ± 6 SE ...)

Discrepancy between summary() and anova() of linear mixed model

I have fitted a linear mixed model with split-plot design to assess the effects of water, nitrogen and phosphorus on BWC (biomass-weighted 2c-value, achieved by summing the product of each species' 2C-value(DNA content) with its biomass fraction (species subplot biomass/total subplot biomass):
model1.1<-lmer(log(BWC)~W*N*P+(1|year)+(1|W:Block),data=BWC)
There are two levels for W(0,1), N(0,1) and p(0,1) I would like to use boxplot to report my results with the output of the linear mixed model. However, I'm confused with the output of the linear mixed model.
The estimated value (slope) for WNP in model1.1 is negative, Does that mean WNP treatment will decrease BWC comparing to control plot? But we can see the BWC was highest in boxplot under the WNP treatment.
There is a discrepancy between summary() and anova(), for example, the significance for N and P effects. Estimate value for N is-4.0911 which means N addition decreased BWC But N effect was insignificant. How can I report the treatment effects like N?
Many thanks for any comments.
Boxplot of WNP treatment on BWC:
enter image description here
https://i.stack.imgur.com/cKOFt.png
(Sorry for the links,it seem I need at least 10 reputations to post images)
The summary() and anova() output:
> summary(model1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: BWC ~ W * N * P + (1 | year) + (1 | W:Block)
Data: BWC
REML criterion at convergence: 2969.1
Scaled residuals:
Min 1Q Median 3Q Max
-2.93847 -0.71228 -0.07573 0.68191 2.92589
Random effects:
Groups Name Variance Std.Dev.
W:Block (Intercept) 0.9169 0.9575
year (Intercept) 0.8346 0.9136
Residual 18.2966 4.2774
Number of obs: 515, groups: W:Block, 14; year, 10
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 10.8498 0.6985 46.5200 15.532 < 2e-16 ***
W1 2.0844 0.8969 45.9613 2.324 0.02460 *
N1 -4.0911 0.7364 486.0288 -5.556 4.56e-08 ***
P1 -2.0460 0.7600 490.1120 -2.692 0.00734 **
W1:N1 4.6738 1.0394 485.9800 4.497 8.65e-06 ***
W1:P1 0.9695 1.0687 485.9809 0.907 0.36478
N1:P1 5.7550 1.0687 485.9773 5.385 1.13e-07 ***
W1:N1:P1 -3.3306 1.5100 485.9541 -2.206 0.02788 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) W1 N1 P1 W1:N1 W1:P1 N1:P1
W1 -0.645
N1 -0.531 0.414
P1 -0.515 0.401 0.488
W1:N1 0.376 -0.582 -0.708 -0.346
W1:P1 0.366 -0.566 -0.347 -0.706 0.488
N1:P1 0.366 -0.285 -0.689 -0.706 0.488 0.502
W1:N1:P1 -0.259 0.400 0.488 0.499 -0.688 -0.708 -0.708
> anova(model1)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
W 750.15 750.15 1 11.90 40.9995 3.519e-05 ***
N 10.84 10.84 1 485.95 0.5926 0.44177
P 29.14 29.14 1 494.92 1.5926 0.20755
W:N 290.51 290.51 1 485.95 15.8778 7.793e-05 ***
W:P 15.54 15.54 1 485.96 0.8493 0.35721
N:P 536.85 536.85 1 485.95 29.3415 9.562e-08 ***
W:N:P 89.01 89.01 1 485.95 4.8648 0.02788 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> emmeans::emmeans(model1,pairwise~N*P*W)
$emmeans
N P W emmean SE df lower.CL upper.CL
0 0 0 10.85 0.699 46.9 9.44 12.26
1 0 0 6.76 0.696 46.2 5.36 8.16
0 1 0 8.80 0.721 52.1 7.36 10.25
1 1 0 10.47 0.721 52.1 9.02 11.91
0 0 1 12.93 0.696 46.2 11.53 14.33
1 0 1 13.52 0.696 46.2 12.12 14.92
0 1 1 11.86 0.721 52.1 10.41 13.30
1 1 1 14.86 0.721 52.1 13.42 16.31
Degrees-of-freedom method: kenward-roger
Confidence level used: 0.95

Means of different groups in ANCOVA with 2 factors R

I am currently studying the influence of different traits on the shell volume of a snail.
I have a dataframe, where each line represents a given individual, and several columns with all its attributes (length, shell volume, sex, infection).
I made the ANCOVA: mod=aov(log(volume) ~ infection*sex*log(length)).
I got this:
Df Sum Sq Mean Sq F value Pr(>F)
inf 1 4.896 4.896 258.126 <2e-16 ***
sex 1 3.653 3.653 192.564 <2e-16 ***
log(length) 1 14.556 14.556 767.335 <2e-16 ***
inf:sex 1 0.028 0.028 1.472 0.227
inf:log(length) 1 0.020 0.020 1.064 0.304
sex:log(length) 1 0.001 0.001 0.076 0.783
inf:sex:log(length) 1 0.010 0.010 0.522 0.471
Residuals 174 3.301 0.019
So significant effects of sex, infection and length, but no interaction terms.
Since there are no interactions, I would like to know, for a given sex, whether the intercept of log(volume) = f(log(length)) is bigger for infected individuals or uninfected individuals.
I tried to use summary.lm(mod), which gave me this:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.42806 0.15429 -2.774 0.00613 **
infmic -0.54963 0.40895 -1.344 0.18070
sexM -0.11542 0.35508 -0.325 0.74554
log(length) 2.41915 0.11144 21.709 < 2e-16 ***
infmic:sexM 0.52459 0.63956 0.820 0.41320
infmic:log(length) 0.43215 0.33717 1.282 0.20166
sexM:log(length) 0.04207 0.28113 0.150 0.88122
infmic:sexM:log(length) -0.38222 0.52920 -0.722 0.47110
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1377 on 174 degrees of freedom
Multiple R-squared: 0.8753, Adjusted R-squared: 0.8703
F-statistic: 174.5 on 7 and 174 DF, p-value: < 2.2e-16
But I have trouble interpreting the results, and still don't see how to conclude.
I also have "few" other questions:
Why aren't sex and infection significant in the lm output?
I know it is not significant here,but how to interpret the lines about the interaction terms?
What I think is that infmic:sexM represents the change in the slope of log(volume)=f(log(length)) for infected males compared with uninfected females. Then, would infmic:length be the change of slope between infected females and uninfected females? And sexM:length the change between uninfected males and uninfected females? Is this true?
And what does the triple interaction term represent?
Thanks a lot!
EDIT: I found part of the answer.
Let's split the data in 4 groups (F-NI, F-I, M-NI, M-I), and look for the equation of the regression line log(volume) = f(log(length)) for each of these groups. Here, the coefficients are the ones given by the function summary.lm(mod)
The equations are:
For non-infected females:log(volume) = (Intercept) + log(length)
For infected females:log(volume) = (Intercept) + infmic + log(length) + infmic:log(length)
For non-infected males:log(volume) = (Intercept) + sexM + log(length) + sexM:log(length)
For infected males:log(volume) = (Intercept) + infmic + sexM + infmic:sexM + log(length) + infmic:log(length) + sexM:log(length) + infmic:sexM:log(length)
For each equation, the slope is the part that starts with log(length), and the intercept is the part before.
It might be obvious for some of you, but I really didn't understand what each coefficient represented at first, so I prefer to put it here!
Alice

Survey package (survival analysis)

I am using the survey package to analyse a longitudinal database. The data looks like
personid spellid long.w Dur rc sex 1 10 age
1 1 278 6.4702295519 0 0 47 20 16
2 1 203 2.8175129012 1 1 126 87 62
3 1 398 6.1956669321 0 0 180 6 37
4 1 139 7.2791061847 1 0 104 192 20
7 1 10 3.6617503439 1 0 18 24 25
8 1 3 2.265464682 0 1 168 136 40
9 1 134 6.3180994022 0 1 116 194 35
10 1 272 6.9167936912 0 0 39 119 45
11 1 296 5.354798213 1 1 193 161 62
After the variable SEX I have 10 bootstrap weights, then the variable Age.
The longitudinal weight is given in the column long.w
I am using the following code.
data.1 <- read.table("Panel.csv", sep = ",",header=T)
library(survey)
library(survival)
#### Unweigthed model
mod.1 <- summary(coxph(Surv(Dur, rc) ~ age + sex, data.1))
mod.1
coxph(formula = Surv(Dur, rc) ~ age + sex, data = data.1)
n= 36, number of events= 14
coef exp(coef) se(coef) z Pr(>|z|)
age -4.992e-06 1.000e+00 2.291e-02 0.000 1.000
sex 5.277e-01 1.695e+00 5.750e-01 0.918 0.359
exp(coef) exp(-coef) lower .95 upper .95
age 1.000 1.00 0.9561 1.046
sex 1.695 0.59 0.5492 5.232
Concordance= 0.651 (se = 0.095 )
Rsquare= 0.024 (max possible= 0.858 )
### --- Weights
weights <- data.1[,7:16]*data.1$long.w
panel <-svrepdesign(data=data.1,
weights=data.1[,3],
type="BRR",
repweights=weights,
combined.weights=TRUE
)
#### Weighted model
mod.1.w <- svycoxph(Surv(Dur,rc)~ age+ sex ,design=panel)
summary(mod.1.w)
Balanced Repeated Replicates with 10 replicates.
Call:
svycoxph.svyrep.design(formula = Surv(Dur, rc) ~ age + sex, design = panel)
n= 36, number of events= 14
coef exp(coef) se(coef) z Pr(>|z|)
age 0.0198 1.0200 0.0131 1.512 0.131
sex 1.0681 2.9098 0.2336 4.572 4.84e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
age 1.02 0.9804 0.9941 1.047
sex 2.91 0.3437 1.8407 4.600
Concordance= 0.75 (se = 0.677 )
Rsquare= NA (max possible= NA )
Likelihood ratio test= NA on 2 df, p=NA
Wald test = 28.69 on 2 df, p=5.875e-07
Score (logrank) test = NA on 2 df, p=NA
### ----
> panel.2 <-svrepdesign(data=data.1,
+ weights=data.1[,3],
+ type="BRR",
+ repweights=data.1[,7:16],
+ combined.weights=FALSE,
+ )
Warning message:
In svrepdesign.default(data = data.1, weights = data.1[, 3], type = "BRR", :
Data look like combined weights: mean replication weight is 101.291666666667 and mean sampling weight is 203.944444444444
mod.2.w <- svycoxph(Surv(Dur,rc)~ age+ sex ,design=panel.2)
> summary(mod.2.w)
Call: svrepdesign.default(data = data.1, weights = data.1[, 3], type = "BRR",
repweights = data.1[, 7:16], combined.weights = FALSE, )
Balanced Repeated Replicates with 10 replicates.
Call:
svycoxph.svyrep.design(formula = Surv(Dur, rc) ~ age + sex, design = panel.2)
n= 36, number of events= 14
coef exp(coef) se(coef) z Pr(>|z|)
age 0.0198 1.0200 0.0131 1.512 0.131
sex 1.0681 2.9098 0.2336 4.572 4.84e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
age 1.02 0.9804 0.9941 1.047
sex 2.91 0.3437 1.8407 4.600
Concordance= 0.75 (se = 0.677 )
Rsquare= NA (max possible= NA )
Likelihood ratio test= NA on 2 df, p=NA
Wald test = 28.69 on 2 df, p=5.875e-07
Score (logrank) test = NA on 2 df, p=NA
The sum of the longitudinal weights is 7,342. The total of events must be around 2,357 and the censored observations a total of 4,985 for a "population" of 7,342 individuals
Do models mod.1.w and mod.2.w take into consideration the longitudinal weights? If the do, why the summary report only n= 36, number of events= 14 ?
The design works well if I take other statistics. For example the mean of Dur in data.1 without considering the sampling design is around 4.9 and 5.31 when I consider svymean(~Dur, panel.2) for example.

Resources