lin.coef: Linear Coefficients

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Returns the slope and intercept for x predicting y

Usage

1
lin.coef(x, y, out = "both", nomiss = 0.8)

Arguments

x

A numeric vector of the same length as y

y

A numeric vector of the same length as x

out

A character vector specifying whether the result should return just the intercept ("int"), just the slope ("slope") or both ("both") which defaults to "both"

nomiss

A numeric between .00 and 1.00 specifying the proportion of x-y pairs required to be complete before NA is returned instead of the regression coefficients. The default of .80 means that if more than 20 percent of the x-y pairs are incomplete an NA will be returned.

Details

This function is largely designed to increase computation efficiency for getting regression coefficients. For instance, this function is called by the Profile.reg function (see Profile.reg).

Value

b0

intercept of the regression line from y predicted from x

b1

slope of the regression line frome y predicted from x

Author(s)

Ryne A. Sherman

See Also

Profile.reg

Examples

1
2
3
4
5
data(RSPdata)
	# Lets predict self reported extraversion from gender
lin.coef(RSPdata$ssex,RSPdata$sEXT)
	# confirm that these numbers match the results from lm()
lm(sEXT ~ ssex, data = RSPdata)

multicon documentation built on May 2, 2019, 3:18 a.m.