ols: Ordinary Least Square regression

View source: R/models.R

olsR Documentation

Ordinary Least Square regression

Description

This is a function that estimates coefficients for a linear model using Ordinary Least Squares (OLS) regression.

Usage

ols(data,y,x,alpha=0.025,verbose=TRUE)

Arguments

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

Value

coefficients of the linear model, or a table with the coefficients, standard errors, t-values, p-values and confidence intervals

Examples

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")

ProxReg documentation built on April 3, 2025, 9:21 p.m.