Description Usage Arguments Details Value Examples
function to fit a linear model
1 2 3 4 5 6 7 8 9 10 |
mf |
a named dataframe of complete data |
intercept |
an interger equals to 0 or 1. If 0, intercept should not be included in the model |
model |
logical. If TRUE the the model frame is returned. |
x |
logical. If TRUE the the model matrix is returned. |
y |
logical. If TRUE the response is returned. |
qr |
logical. If TRUE the the QR is returned. |
offset |
'offset' is a vector with the same length of data. If null, the data frame "mf" does not contain an offset column, else, the offset column is offset vector |
weights |
'weights' is a vector with the same length of data. If null, the data frame "mf" does not contain an weights column, else, the weights column is offset vector |
you can use this function to fit for a linear model return a list of results.
'model_fit' returns a list of results containing the following components:
fitted.values: a n*1 matrix containing the fitted value
beta_hat: a n*1 matrix containing the fitted coefficients
coefficients: a n*1 matrix containing the residuals (observed values - fitted values)
residuals: a n*1 matrix containing the residuals (observed values - fitted values)
offset: if not null, a n*1 matrix containing the offset values.
weights: if not null, a n*1 matrix containing the weights values.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.