Learn R Programming

sanon (version 1.2)

contrast: Contrast for Model Parameters

Description

Inference by contrast of parameters in a fitted model.

Usage

contrast(object, C = diag(length(object$b)),
    confint = FALSE, level = 0.95, ...)

  ## S3 method for class 'contrast':
print(x, ...)

Arguments

object,x
an object of class "sanon", usually, a result of a call to sanon.
C
contrast matrix. The number of column should be same as the length of b in outputs of sanon.
confint
logical value for whether the confidence interval is computed (only if C has one row).
level
the confidence level required (only if C has one row).
...
further arguments passed to or from other methods.

Value

  • Ccontrast matrix
  • Cbcontrast estimates
  • VCbvariance and covariance matrix of Cb
  • sestandard error of Cb
  • levelconfidence level
  • ULupper confidence limit (only if the number of row of C = 1, otherwise NULL)
  • LLlower confidence limit (only if the number of row of C = 1, otherwise NULL)
  • Qtest statistic
  • dfdegree of freedom
  • pp-value

Details

This function provide the inference based on contrast after applying the function sanon. The contrast matrix C should be defined by the user. If the the number of row of C = 1, the confidence interval for the estimator is produced.

Examples

Run this code
##### Example 3.2 Randomized Clinical Trial of Respiratory Disorder #####
data(resp)
P = rbind(rep(0, 4), diag(4), rep(0, 4))
out23 = sanon(cbind(baseline, visit1, visit2, visit3, visit4) ~ grp(treatment, ref="P")
 + strt(center) + strt(sex) + covar(age), data=resp, P=P)

# Homogeneity of the xi_k across the four visits
contrast(out23, C=cbind(diag(3), rep(-1, 3)))

# Comparison between treatments for the average of the xi_k across the 4 visits
contrast(out23, C=matrix(rep(1, 4)/4, ncol=4))

Run the code above in your browser using DataLab