lm_adjusted_r_squared: Calculate adjusted r-squared using lm object

Description Usage Arguments Value Examples

View source: R/adjusted_r_squared.R

Description

This function is an alternative way of calling adjusted_r_squared. It derives n, p, and rsquared from an lm object.

Usage

1
2
lm_adjusted_r_squared(fit, method = c("ezekiel", "smith", "olkinpratt",
  "pratt", "wherry1", "wherry2"))

Arguments

fit

object of class lm

method

method used calculating r-squared (see adjusted_r_squared)

Value

adjusted r-squared

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Get data and meta data
data(facets_data); data(facets_meta)
facets_meta$ipip_factors

# Example showing the use of the regression function
fit1 <- regression('swl', ivs= facets_meta$ipip_factors, data=facets_data)
lm_adjusted_r_squared(fit1, method='olkinpratt')

# Example showing use of lm formula and how ezekiel values are equivalent
fit2 <- lm(swl ~ ipip_extraversion + ipip_openness, facets_data)
lm_adjusted_r_squared(fit2, method='ezekiel')
summary(fit2)$adj.r.squared

jeromyanglim/personalityfacets documentation built on Dec. 23, 2019, 7:31 p.m.