You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(brms)
### use brms package dataframe
data("kidney")
### create random propensity scores to simulate the database
kidney$sw <- runif( nrow(kidney), min=0.5, max=2.5 )
### create the brm model
model <- brms::brm(
time | cens(censored) ~ sex,
data = kidney,
family = cox()
)
and everything works fine. I tried to implement weights but I cannot figure out the syntax:
model <- brms::brm(
Surv( time, censored ) | weights(sw) ~ sex,
data = kidney,
family = cox()
)
Error in Ops.Surv(y, 0) : Invalid operation on a survival time
How can I specify weights if I am using a cox() syntax?
The text was updated successfully, but these errors were encountered:
I already started a topic on stackoverflow: Using IPTW weights inside a Bayesian brm() cox model
I can create a Bayesian coxph model with brms:
and everything works fine. I tried to implement weights but I cannot figure out the syntax:
How can I specify weights if I am using a cox() syntax?
The text was updated successfully, but these errors were encountered: