knitr::opts_chunk$set(echo = TRUE)

Loading the data

data(cats, package="MASS")

source("ols.R")

result<-ols(cbind(1,cats$Bwt),cats$Hwt)

summary(result)

Including Plots

You can also embed plots, for example:

source("olslinmod.R")

x = cbind(Const=1, Bwt=cats$Bwt)
y = cats$Hw
mod1 <- linmod(x, y)
mod1

# 

summary(mod1)
summary(linmod(Hwt~Bwt*Sex, data=cats))

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.



saafdk/Rpackage documentation built on March 23, 2020, 12:46 a.m.