fit.1ln.rprt: Report a model fit in a single line of text output

View source: R/reporting.R

fit.1ln.rprtR Documentation

Report a model fit in a single line of text output

Description

This function takes a fit multivariate regression model as input and converts the normal tabular output into a single line using repeated "+"or"-" symbols for significance

Usage

fit.1ln.rprt(fit, method=c('std.dev','p-value')[1], decimal.places=3, 
             name.char.len=6, print.inline=TRUE, rtrn.line=FALSE, R2=TRUE,mn='')

Arguments

fit

a fit model

method

how to calculate the number of pluses or minuses before each coefficient name (default is standard deviations)

decimal.places

the number of decimal places to use in reporting p-values

name.char.len

the maximum length to use when truncating variable names

R2

boolean for also returning/printing R^2 values

print.inline

should the outout string be printed to the terminal?

rtrn.line

should the output string be returned as a characters string?

mn

model number prefixed to printout if 'print.inline' is TRUE

Value

A character string of the form "++var1 +var5 var3 | -var2 –var4" indicating signifcance and direction of regression results

Examples


# Motor Trend car data
fit.1ln.rprt(lm('mpg ~ cyl + hp + wt + gear + disp', data=mtcars))

# Tooth Growth data
fit.1ln.rprt(lm('len ~ dose + supp', data=ToothGrowth))

# Earthquake attenuation data
fit.1ln.rprt(lm('accel ~ dist + mag', data=attenu))

# Fertility data
fit.1ln.rprt(lm('parity ~ age  + education + spontaneous + induced', data=infert), name.char.len=18)


caroline documentation built on Oct. 21, 2024, 9:06 a.m.