contrast: Contrast for Model Parameters

Description Usage Arguments Details Value Examples

View source: R/sanon.r

Description

Inference by contrast of parameters in a fitted model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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.

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.

Value

C

contrast matrix

Cb

contrast estimates

VCb

variance and covariance matrix of Cb

se

standard error of Cb

level

confidence level

UL

upper confidence limit (only if the number of row of C = 1, otherwise NULL)

LL

lower confidence limit (only if the number of row of C = 1, otherwise NULL)

Q

test statistic

df

degree of freedom

p

p-value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
##### 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))

sanon documentation built on July 8, 2020, 6:54 p.m.