rms icon indicating copy to clipboard operation
rms copied to clipboard

contrast() with conf.type='simultaneous' with orm() fails

Open mshunshin opened this issue 6 years ago • 0 comments

Minimal test case

xa <- runif(100, 0, 5)
xb <- runif(100, 0, 5)

ya <- xa + rnorm(100, 0, 1)
yb <- xb + rnorm(100, 0.25, 1)

arma <- rep("Placebo", 100)
armb <- rep("Intervention", 100)

x <- c(xa, xb)
y <- c(ya, yb)
arm <- c(arma, armb)

dd <- datadist(x, y, arm)
options(datadist="dd")

# Works
f_ols <- ols(y ~ x + arm)
c_ols <- contrast(f_ols, list(arm="Placebo"), list(arm="Intervention"), conf.type='simultaneous')

# Fails with dimensions of coefficients and covariance matrix don't match 
f_orm <- orm(y ~ x + arm)
c_orm <- contrast(f_orm, list(arm="Placebo"), list(arm="Intervention"), conf.type='simultaneous')
# Error in modelparm.default(model, ...) : dimensions of coefficients and covariance matrix don't match

mshunshin avatar Jan 24 '19 00:01 mshunshin