ols | R Documentation |
This is a function that estimates coefficients for a linear model using Ordinary Least Squares (OLS) regression.
ols(data,y,x,alpha=0.025,verbose=TRUE)
data |
Dataset used to estimated the coefficients |
y |
name of the dependent variable |
x |
name or a vector of names of the independent variables |
alpha |
confedence level |
verbose |
logical, if TRUE, the table will be printed |
coefficients of the linear model, or a table with the coefficients, standard errors, t-values, p-values and confidence intervals
df = data.frame("hours"=c(1, 2, 4, 5, 5, 6, 6, 7, 8, 10, 11, 11, 12, 12, 14),
"score"=c(64, 66, 76, 73, 74, 81, 83, 82, 80, 88, 84, 82, 91, 93, 89))
ols(df,"score","hours")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.