Run_Regression: Regression Analysis

View source: R/Run_Regression.R

Run_RegressionR Documentation

Regression Analysis

Description

This function conducts a regression analysis and provides the results in a pdf file. It can also perform predictions on a new csv data file and provide the results in a csv file.

Usage

Run_Regression(mydata, myformula, prediction_data = 0, resizepaper = 1)

Arguments

mydata

csv data file

myformula

formula for the lm() model

prediction_data

csv data file with the same set of variable names as those in the mydata data set; intended for prediction. The da The default value set at 0 tells the function that no prediction data set has been provided by the user.

resizepaper

How much larger should the pdf paper size be to fit everything?

Examples

## Not run: 
# This is the sample code to be copied and used in a new R Script:
library(listentodata)
clear_console()
mydata = load_csv_data()
head(mydata) #shows top rows in the Console
str(mydata) #shows structure of the data
myformula = "Sales ~ ."
resizepaper = 1
Run_Regression(mydata, myformula, resizepaper)
# If you have data for prediction:
prediction_data = load_csv_data()
Run_Regression(mydata, myformula, prediction_data, resizepaper)

## End(Not run)

1moein/listentodata documentation built on Nov. 14, 2024, 5:35 p.m.