An R6 class that stores results for a contrast of the form \(L \theta - m\) estimated using a specified object inheriting from FamModelFit. Wald tests and confidence intervals for individual rows of the contrast matrix as well as an overall Wald chi-square test of the null hypothesis \(L \theta - m = 0\) are provided.

Methods

Public methods


Method new()

Constructs a new instance of this class.

Usage

Contrast$new(model_fit, L_mat, m)

Arguments

model_fit

An object inheriting from FamModelFit.

L_mat

A contrast vector (1 df) or matrix (>1 df) containing one contrast in each row. The contrast vector must have a number of elements equal to the number of model parameters. The contrast matrix must be of full row rank and have a number of columns equal the number of model parameters.

m

An optional vector containing the null value for each contrast. Will be set to the zero vector of length nrow(L_mat) if not specified.


Method get_model_fit()

Returns model_fit object.

Usage

Contrast$get_model_fit()


Method get_L_mat()

Returns L_mat.

Usage

Contrast$get_L_mat()


Method get_m()

Returns m.

Usage

Contrast$get_m()


Method get_L_theta_hat_m()

Returns \(L \hat{\theta} - m\).

Usage

Contrast$get_L_theta_hat_m()


Method get_V_L_theta_hat()

Returns \(L \hat{V}(\hat{\theta}) L^{'}\).

Usage

Contrast$get_V_L_theta_hat()


Method get_X2()

Returns Wald chi-square statistic for null hypothesis \(L \theta - m = 0\), which is \((L \hat{\theta} - m)^{'} [L \hat{V}(\hat{\theta}) L^{'}]^{-1} (L \hat{\theta} - m)\).

Usage

Contrast$get_X2()


Method get_df_X2()

Returns degrees of freedom of Wald chi-square statistic, which is the rank of \(L\).

Usage

Contrast$get_df_X2()


Method get_p_X2()

Returns p-value for Wald chi-square statistic.

Usage

Contrast$get_p_X2()


Method print()

Formatted printing of the Contrast object.

Usage

Contrast$print(...)

Arguments

...

Arguments passed on to print_ests().


Method clone()

The objects of this class are cloneable with this method.

Usage

Contrast$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.