Learn R Programming

ivregEX (version 1.0)

senslm: Sensitivity analysis of a least squared regression estimator

Description

Performs a sensitivity analysis of the least squared regression

Usage

senslm(lmfit, coefmat, variable, delta1 = seq(-0.1, 0.1, 0.01), alpha = 0.05, ...)

Arguments

lmfit

An obeject of class "lm".

coefmat

Optional matrix of class "coeftest" an output of coeftest.

variable

Treatment variable of interest.

delta1

A numeric vector of values of the first sensitivity parameter. Default value seq(-.1, .1, .01).

alpha

Significance level. Default at 0.05.

May be ignored, used in sensOLS.

Value

Returns an object of class "si".

An object if class "si" is essentially a matrix of two columns for the the upper and lower sensitivity limits corresponding to the sensitivity parameters.

Details

delta1 is the partial correlation of the unobservable and the treatment. It measures the amount of violation in the assumption of no-unmeasured confounding.

See Also

sensIvreg, plot.sensIvregEX, plot.si

Examples

Run this code
# NOT RUN {
	
data("CigarettesSW", package = "AER")
CigarettesSW$rprice <- with(CigarettesSW, price/cpi)
CigarettesSW$rincome <- with(CigarettesSW, income/population/cpi)
CigarettesSW$tdiff <- with(CigarettesSW, (taxs - tax)/cpi)

lmfit <- lm(log(packs) ~ log(rprice) + log(rincome), data = CigarettesSW, subset = year == "1995")

z <- senslm(lmfit, variable = 'log(rprice)')

# }

Run the code above in your browser using DataLab