neLht-methods: Methods for linear hypotheses in natural effect models

neLht-methodsR Documentation

Methods for linear hypotheses in natural effect models

Description

Obtain confidence intervals and statistical tests for linear hypotheses in natural effect models.

Usage

## S3 method for class 'neLhtBoot'
confint(object, parm, level = 0.95, type = "norm", ...)

## S3 method for class 'neLht'
confint(object, parm, level = 0.95, calpha = univariate_calpha(), ...)

## S3 method for class 'neLht'
summary(object, test = univariate(), ...)

Arguments

object

an object of class neLht.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

type

the type of bootstrap intervals required. The default "norm" returns normal approximation bootstrap confidence intervals. Currently, "norm", "basic", "perc" and "bca" are supported (see boot.ci).

...

additional arguments.

calpha

a function computing the critical value. The default univariate_calpha() returns unadjusted confidence intervals, whereas adjusted_calpha() returns adjusted confidence intervals.

test

a function for computing p-values. The default univariate() does not apply a multiple testing correction. The function adjusted() allows to correct for multiple testing (see summary.glht and adjusted) and Chisquare() allows to test global linear hypotheses.

Details

confint yields bootstrap confidence intervals or confidence intervals based on the sandwich estimator (depending on the type of standard errors requested when fitting the neModel object). Bootstrap confidence intervals are internally called via the boot.ci function from the boot package. Confidence intervals based on the sandwich estimator are internally called via the corresponding confint.glht function from the multcomp package. The default confidence level specified in level (which corresponds to the conf argument in boot.ci) is 0.95 and the default type of bootstrap confidence interval, "norm", is based on the normal approximation. Bias-corrected and accelerated ("bca") bootstrap confidence intervals require a sufficiently large number of bootstrap replicates (for more details see boot.ci).

A summary table with large sample tests, similar to that for glht, can be obtained using summary.

In contrast to summary.glht, which by default returns p-values that are adjusted for multiple testing, the summary function returns unadjusted p-values. Adjusted p-values can also be obtained by specifying the test argument (see adjusted for more details).

Global Wald tests considering all linear hypotheses simultaneously (i.e. testing the global null hypothesis) can be requested by specifying test = Chisqtest().

See glht-methods for additional methods for glht objects.

Note

For the bootstrap, z-values in the summary table are simply calculated by dividing the parameter estimate by its corresponding bootstrap standard error. Corresponding p-values in the summary table are only indicative, since the null distribution for each statistic is assumed to be approximately standard normal. Therefore, whenever possible, it is recommended to focus mainly on bootstrap confidence intervals for inference, rather than the provided p-values.

See Also

neLht, plot.neLht, glht, glht-methods

Examples

data(UPBdata)

impData <- neImpute(UPB ~ att * negaff + gender + educ + age, 
                    family = binomial, data = UPBdata)
neMod <- neModel(UPB ~ att0 * att1 + gender + educ + age, 
                 family = binomial, expData = impData, se = "robust")

lht <- neLht(neMod, linfct = c("att0 = 0", "att0 + att0:att1 = 0", 
                               "att1 = 0", "att1 + att0:att1 = 0", 
                               "att0 + att1 + att0:att1 = 0"))

## obtain confidence intervals
confint(lht)
confint(lht, parm = c("att0", "att0 + att0:att1"))
confint(lht, parm = 1:2, level = 0.90)

## summary table
summary(lht)

## summary table with omnibus Chisquare test
summary(lht, test = Chisqtest())

medflex documentation built on July 10, 2023, 2 a.m.