View source: R/lm_betaselect_methods.R
predict.glm_betaselect | R Documentation |
Compute the predicted
values in a model fitted by
glm_betaselect()
.
## S3 method for class 'glm_betaselect'
predict(
object,
model_type = c("beta", "standardized", "raw", "unstandardized"),
newdata,
...
)
object |
A |
model_type |
The model from which the
the predicted values are computed.
For
|
newdata |
If set to a data
frame, the predicted values are
computed using this data frame.
The data must be unstandardized.
That is, the variables are of the
same units as in the data frame
used in |
... |
Arguments
to be passed to |
It simply passes the model before
or after selected variables
are standardized to the
predict
-method of a glm
object.
Some statistics, such as prediction or confidence interval, which make use of the sampling variances and covariances of coefficient estimates may not be applicable to the models with one or more variables standardized. Therefore, they should only be used for exploratory purpose.
It returns the output of stats::predict.glm()
.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
glm_betaselect()
and stats::predict.glm()
data_test_mod_cat$p <- scale(data_test_mod_cat$dv)[, 1]
data_test_mod_cat$p <- ifelse(data_test_mod_cat$p > 0,
yes = 1,
no = 0)
logistic_beta_x <- glm_betaselect(p ~ iv*mod + cov1 + cat1,
data = data_test_mod_cat,
family = binomial,
to_standardize = "iv")
predict(logistic_beta_x)
predict(logistic_beta_x, model_type = "raw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.