predict.relvms: Multiple Group score

Description Usage Arguments Value Examples

View source: R/pred_groups.R

Description

Predict the group scores (random effect latent variabl) from the extimated parameters

Usage

1
2
## S3 method for class 'relvms'
predict(x, newpars = NULL, newdata = NULL, level = 0.95)

Arguments

x

An object, whose class attribute is "relvms", i.e. multiple group of relvm. see also relvm function.

newpars

The matrix of modified parameters (factor loadings, etc.).

newdata

The new data table. this table include standardized measure score and measure weight. See example below.

level

The level of confident interval. This parameter may not be used any more.

Value

A updated object.

Examples

1
2
3
4
5
6
7
8
# predict with new parameters
fit  <- relvm(mstbl(rstarating::cms_star_rating_input_2017dec))
pred <- predict(fit,newpars=fit$groups$pars) # update the newpars.
star <- rating(x=pred$groups$summary_score,method="rclus2",score_col="sum_score",iter.max=5000)

# predict with new data
newdata = list(mstbl_std = fit17$groups$mstbl_std, wtbl = fit17$groups$wtbl)
pred_newdata <- predict(fit,newdata=newdata) # update the newpars.

huangrh/relvm documentation built on May 17, 2019, 9:10 p.m.