predict.pathmod: Predict method for fitted formative-reflective models

Description Usage Arguments Value Examples

View source: R/predict_pathmod.R

Description

Once the formative-reflective model has been estimated with the pathmod() function, you can produce predictions based on old or new data.

Usage

1
2
3
## S3 method for class 'pathmod'
predict(object, newdata = NULL, xmean = NULL,
  ymean = NULL, xsd = NULL, ysd = NULL, ...)

Arguments

object

an object of class pathmod generated by the function pathmod(). If no data were supplied to the function pathmod() through the data parameter, then the parameters

newdata

a data frame containing the x-variables of the model named as they had been named in the xgroups argument passed to the pathmod() function. If you do not supply this argument but data have been passed to the function pathmod() through the data parameter, then the function returs the fitted values.

xmean

numeric vector of x-variable means. If no data and no xmean parameter were supplied to the pathmod() call, then you have to assign this argument, otherwise this parameter is not needed. If you assign it when xmean is available in object, then this value is used instead of the one present in object.

ymean

numeric vector of y-variable means. If no data and no ymean parameter were supplied to the pathmod() call, then you have to assign this argument, otherwise this parameter is not needed. If you assign it when ymean is available in object, then this value is used instead of the one present in object.

xsd

numeric vector of x-variable standard deviations. If no data and no xsd parameter were supplied to the pathmod() call, then you have to assign this argument, otherwise this parameter is not needed. If you assign it when xsd is available in object, then this value is used instead of the one present in object.

ysd

numeric vector of y-variable means. If no data and no ysd parameter were supplied to the pathmod() call, then you have to assign this argument, otherwise this parameter is not needed. If you assign it when ysd is available in object, then this value is used instead of the one present in object.

...

further arguments passed to or from other methods

Value

A list with slots:

xis

3-dimensional array with a matrix of ξ-variables for each value of α

etas

3-dimensional array with a matrix of η-variables for each value of α

xhats

3-dimensional array with a matrix of x-variable predictions for each value of α

yhats

3-dimensional array with a matrix of y-variable predictions for each value of α

Examples

1
2
3
4
5
data(russett)
xg <- list(c("gini", "farm", "rent"), c("gnpr", "labo"))
yg <- list(c("inst", "ecks", "death"))
pm <- pathmod(xg, yg, data = russett[1:40, ])
pr <- predict(pm, russett[41:47, ])

matteopelagatti/pathmod documentation built on May 29, 2019, 4:41 a.m.