uniglm: Univariate glm regression

Description Usage Arguments Value See Also Examples

Description

Runs a univariate logistic regression on each predictor variable of interest.

Usage

1
uniglm(df, yv, xv, file = NULL, sortby = "aic", xvlab = NULL, test = T)

Arguments

df

data.frame with variables for analysis

yv

character string, target variable

xv

character vector, predictor variables to test univariately

file

character string, filepath to write results out to. txt or csv file.

sortby

character string, criteria to sort variables by. Default = 'aic'

xvlab

data.frame, lookup table for variable names. First column is codename, second column is the pretty printed name.

test

TRUE or FALSE. Includes Chi square test, or not.

Value

data.frame of results

See Also

bestglm, leaps

Examples

1
2
3
4
5
6
7
require('Hmisc')

##setting up some data
longnames <- data.frame(long = c('Weight', 'Miles Per Gallon', 'Cylinder', 'D.R.A.T', 'Horsepower', 'A.M.'),
short = c('wt', 'mpg', 'cyl', 'drat', 'hp', 'am'), stringsAsFactors=F)

glm.out <- uniglm(df=mtcars, yv='vs', xv=c('hp','drat','cyl','mpg','wt'), xvlab=longnames)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.