Learn R Programming

medflex (version 0.6-10)

neLht-methods: 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 neLhtBoot
confint(object, parm, level = 0.95, type = "norm", ...)

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

# S3 method for 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.

See Also

neLht, plot.neLht, glht, glht-methods

Examples

Run this code
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())

Run the code above in your browser using DataLab