parameters | R Documentation |
Returns the parameters used to build a model.
parameters(object, ...)
## S3 method for class 'lm'
parameters(object, ...)
## S3 method for class 'bestfit'
parameters(object, ...)
object |
A model object. |
... |
not used. |
the parameters, predictors and response names besides the original data used to build the model.
# 1. Real dataset
data(centro_2015)
centro_2015 <- st_drop_geometry(centro_2015)
fit <- lm(log(valor) ~ ., centro_2015)
p <- parameters(fit)
p$parameters
p$rhs
p$predictors
p$response
p$lhs
p$depvarTrans
p$data
# 2. Random generated data
n <- 20
set.seed(1)
Frente <- rnorm(n = n, mean = 12, sd = 2.5)
Prof <- rnorm(n = n, mean = 25, sd = 5)
Area <- Frente*Prof
# quadratic relationship
VU <- 5000 - 10*Area + .005*Area^2 + 10*Frente + rnorm(n, mean = 0, sd = 150)
d <- data.frame(VU, Area, Frente, Prof)
fit <- lm(VU ~ poly(Area, 2) + Frente, data = d)
p <- parameters(fit)
p$parameters
p$rhs
p$predictors
p$response
p$lhs
p$depvarTrans
p$data
fit1 <- lm(VU ~ poly(Area, 2, raw=TRUE) + Frente, data = d)
p <- parameters(fit1)
p$parameters
p$rhs
p$predictors
p$response
p$lhs
p$depvarTrans
p$data
dados <- st_drop_geometry(centro_2015)
best_fit <- bestfit(valor ~ ., dados)
parameters(best_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.