2
$\begingroup$

I am trying to answer the question of whether service in a certain organization has an effect on age of first marriage, and am interested in using the Cox model to understand the difference in the hazard rates.

Because I have observational data, I'm using a pre-processing technique to achieve covariate balance between the two groups (to account for selection bias), and then trying to estimate the treatment effect of service. Using the WeightIt package, each observation is given a weight, and I would now like to add these to the observations when conducting the Cox regression.

I was introduced to the coxphw package, but am unsure if I am putting the weights in the correct place. Currently, I am putting them in caseweights, where W1 is the object from the WeightIt package.

fit1 <- coxphw(Surv(time1mar, censor) ~ milserve, 
               data = com,
               template = "ARE",
               caseweights=get.w(W1))

Thanks for the help!

$\endgroup$
1
$\begingroup$

Well, folks, I e-mailed the writer of the program, and he confirmed that any weights generated should be specified under the caseweights option.

Cheers!

$\endgroup$
  • $\begingroup$ Thank you for following up! And I'm glad you're finding WeightIt useful! $\endgroup$ – Noah Apr 17 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.