Skip to content

melolcx/biostat625-hw3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear_Regression_Summary

R-CMD-check Codecov test coverage

R package for the summary of linear regression

Linear_Regression_Summary is a package built for the summary of linear regression and it is friendly to rookies.

Description

This package only contains one function "LR", which can be used to produce summary statistics of the model input. It contains more common used output and less output that is not that useful for basic analysis.

Model

The model for linear regression is: Y = Beta_0 + Beta_1 * X_1 + Beta_2 * X_2 + ... + Beta_n * X_n + r

Installation

The package can be installed to R environment with devtools::install.github()

# install using devtools from GitHub:
devtools::install_github("melolcx/biostat625-hw3")

# build vignitte, install with:
devtools::install_github("melolcx/biostat624-hw3", build_vignettes = T)

Functions

The function LR() need 3 inputs: "data, "x" and "y". "data" is the aimed data that you want to fit a linear regression model, "x" is the independent variables that you are interested in and y is for dependent variable. The number of x is not limited while the number of y is limited to 1.

Using this function, there will be a general output for a sheet of statistics with formula, residuals, coefficient, 95% confidence intervals, R-squared and F-ststistic with its p-value.

At the same time, each type of output will be divided with a list so that it will be easier to directly use them with "[]".

Usage

library(LR)
library(datasets)
data(swiss)
data <- swiss
x <- c("Fertility", "Agriculture", "Examination", "Education")
y <- "Infant.Mortality"
LR(data, x, y)

Contribution

melolcx

Contact

melolcx@umich.edu

About

This is hw3 for biostat625 from melolcx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages