Skip to main content
as.numeric does not work
Source Link

design <- svydesign( ~ psu , strat= ~ stratum , weights = ~ sample.weight , nest = TRUE , data = subset( x , sample.weight > 0 ) )is it caused by the zeroes in this table? not sure if those will ever converge?

w <- subset( design , !smoker & age.months >= 5012 & age.months < 8512 )

table( x$bmi.cat , x$bmi.max.cat )

svycoxph(Surv(age.months, mort.status == 'deceased') ~ as.numeric(bmi.cat) * as.numeric( bmi.max.cat ), design = design)if you use fake data

x$bmi.max.cat <- sample(1:5,nrow(x),replace=T)

design <- svydesign( ~ psu , strat= ~ stratum , weights = ~ sample.weight , nest = TRUE , data = subset( x , sample.weight > 0 ) )
w <- subset( design , !smoker & age.months >= 50*12 & age.months < 85*12 )
svycoxph(Surv(age.months, mort.status == 'deceased') ~ bmi.cat * bmi.max.cat, design = w)

design <- svydesign( ~ psu , strat= ~ stratum , weights = ~ sample.weight , nest = TRUE , data = subset( x , sample.weight > 0 ) )

w <- subset( design , !smoker & age.months >= 5012 & age.months < 8512 )

svycoxph(Surv(age.months, mort.status == 'deceased') ~ as.numeric(bmi.cat) * as.numeric( bmi.max.cat ), design = design)

is it caused by the zeroes in this table? not sure if those will ever converge?

table( x$bmi.cat , x$bmi.max.cat )

if you use fake data

x$bmi.max.cat <- sample(1:5,nrow(x),replace=T)

design <- svydesign( ~ psu , strat= ~ stratum , weights = ~ sample.weight , nest = TRUE , data = subset( x , sample.weight > 0 ) )
w <- subset( design , !smoker & age.months >= 50*12 & age.months < 85*12 )
svycoxph(Surv(age.months, mort.status == 'deceased') ~ bmi.cat * bmi.max.cat, design = w)
Source Link

design <- svydesign( ~ psu , strat= ~ stratum , weights = ~ sample.weight , nest = TRUE , data = subset( x , sample.weight > 0 ) )

w <- subset( design , !smoker & age.months >= 5012 & age.months < 8512 )

svycoxph(Surv(age.months, mort.status == 'deceased') ~ as.numeric(bmi.cat) * as.numeric( bmi.max.cat ), design = design)