Learn R Programming

NSM3 (version 1.5)

theil: Function to estimate and perform tests on the slope and intercept of a simple linear model.

Description

This code estimates and performs tests on the slope and intercept of a simple linear model. Based on chapter 9 of Hollander, Wolfe & Chicken, Nonparametric Statistical Methods, 3e.

Usage

theil(x=NULL, y=NULL, alpha=0.05, beta.0=0, type="t", example=FALSE, r=3, slopes=F, doplot=TRUE)

Arguments

x
first data vector
y
second data vector
alpha
the significance level
beta.0
the null hypothesized value
type
can be "t" (two-sided), "u" (upper) or "l" (lower). The type refers both to the test and the confidence interval.
example
if true, will analyze the data from Example 9.1
r
the number of places for rounding. Increase it if your P-values are coming out as 0 or 1.
slopes
if true, will print all n(n-1)/2 slopes
doplot
if true, will plot the data and estimated line

Examples

Run this code
##Example 9.1 Hollander-Wolfe-Chicken##
theil (x, y, example=TRUE, slopes=TRUE)

Run the code above in your browser using DataLab