getYhat: Get predicted value from object of class "lm"

View source: R/addCatVars.R

getYhatR Documentation

Get predicted value from object of class "lm"

Description

Get predicted value from object of class "lm"

Usage

getYhat(fit, group = "D", mode = 1)

Arguments

fit

Object of class "lm"

group

names of dummy variables in formula

mode

Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding

Examples

iris1=addCatVars(iris,c("Species"))
iris3=addCatVars(iris,c("Species"),mode=3)
fit1=lm(Sepal.Length~Sepal.Width+D1+D2,data=iris1)
getYhat(fit1)
fit1=lm(Sepal.Length~D2*Sepal.Width+Sepal.Width*D1+Petal.Width,data=iris1)
getYhat(fit1)
fit3=lm(Sepal.Length~D2*Sepal.Width+Sepal.Width*D1+Petal.Width*D1+Petal.Width*D2,data=iris3)
getYhat(fit3,mode=3)

processR documentation built on Jan. 23, 2023, 5:44 p.m.