Learn R Programming

utest (version 0.4.0)

uslopes: Estimates slopes at extremes

Description

This function estimates the slope of the relationship at the lower and upper extreme points of the independent variable

Usage

uslopes(lmObject, vars, .vcov = NULL, x.min = NULL, x.max = NULL)

Value

A list with class "uslopes" containing the following components:

interval

a vector with the interval for the independent varaible.

slope

a vector with the slope of the relationship at the extremes.

tval

a vector with the t-value of the relationship at the extremes.

pval

a vector with the p-value from a one-sided test a the extremes of the interval.

extreme

the estimated extreme point of the relationship.

Arguments

lmObject

The model to be tested

vars

A vector with the name of the linear and squared terms. Can also be provided as a formula

.vcov

The covariance matrix to use

x.min

Lower bound of interval. If NULL, the minimum observed in the data is used.

x.max

Upper bound of interval. If NULL, the maximum observed in the data is used.

Details

The function computes slopes of a quadratic relationship at the lower and upper bound defined by x.min and x.max. Standard errors of the estimated slopes, t-values, and p-values from a one-sided test of a flat relationship as well as the extreme point of the estimated relationship are also provided.

See Also

utest

Examples

Run this code
x <- runif(100,min=-1,max=1)
xsq <- x^2
y <- x^2+rnorm(100)
mod <- lm(y~x+xsq)

uslopes(mod,c("x","xsq"))
uslopes(mod,~x+xsq,x.max=0.8)

Run the code above in your browser using DataLab