Description Usage Arguments See Also Examples
Obtains measurement for the fits based on estimates beta1, beta2 and covariance matrix from a rank based methods.
1 | fitdvcov(x1, beta1, beta2, vcw)
|
x1 |
data |
beta1 |
model 1 beta estimate |
beta2 |
model 2 beta estimate |
vcw |
variance matrix |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Compare GR and JR methods
data(schools)
model = y ~ 1 + sex + age + (1 | region) + (1 | region:school)
# Extract covariants into matrix
cov = as.matrix(data.frame(schools[,"sex"], schools[,"age"]))
# Fit the models using each method
jr.fit = rlme(model, schools, method="jr")
gr.fit = rlme(model, schools, method="gr")
# Extract beta estimates, ignoring the intercept
jr.beta = jr.fit$fixed.effects$Estimate[c(2, 3)]
gr.beta = gr.fit$fixed.effects$Estimate[c(2, 3)]
# Extract beta variance matrix
var.b = jr.fit$var.b
fitdvcov(cov, jr.beta, gr.beta, var.b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.