Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Rsq

Multiple R-squared


Description

Function to calculate the multiple R-squared and the adjusted R-squared from a fitted model via lm or aov, i.e., linear models. For a model fitted via nls, nonlinear models, the pseudo R-squared is returned.

Usage

Rsq(model)

Arguments

model

a model fitted via lm, aov or nls.

Value

A list of

R.squared

the multiple R-squared (for linear models) or the Pseudo R-squared (for nonlinear models).

adj.R.squared

the adjusted R-squared.

Author(s)

Anderson Rodrigo da Silva <anderson.agro@hotmail.com>

See Also

Examples

# example 1 [linear model]
y <- rnorm(10)
x <- 1:10
fit <- lm(y ~ x)
summary(fit)
Rsq(fit)

# example 2 [nonlinear model for Load Bearing Capacity]
data(compaction)
attach(compaction)
out <- fitlbc(theta = Mois, sigmaP = PS)
summary(out)
Rsq(out)

# End (not run)

soilphysics

Soil Physical Analysis

v4.0
GPL (>= 2)
Authors
Anderson Rodrigo da Silva [aut, cre] (<https://orcid.org/0000-0003-2518-542X>), Renato Paiva de Lima [aut] (<https://orcid.org/0000-0003-0524-439X>)
Initial release
2020-12-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.