changedata: Change the data of a psychonetrics object

Description Usage Arguments Value Author(s)

View source: R/f_conveneince_changedata.R

Description

This function can be used to change the data in a psychonetrics object.

Usage

1
changedata(x, data, covs, nobs, means, groups, missing = "listwise")

Arguments

x

A psychonetrics model.

data

A data frame encoding the data used in the analysis. Can be missing if covs and nobs are supplied.

covs

A sample variance–covariance matrix, or a list/array of such matrices for multiple groups. IMPORTANT NOTE: psychonetrics expects the maximum likelihood (ML) covariance matrix, which is NOT obtained from cov directly. Manually rescale the result of cov with (nobs - 1)/nobs to obtain the ML covariance matrix.

nobs

The number of observations used in covs and means, or a vector of such numbers of observations for multiple groups.

means

A vector of sample means, or a list/matrix containing such vectors for multiple groups.

groups

An optional string indicating the name of the group variable in data.

missing

How should missingness be handled in computing the sample covariances and number of observations when data is used. Can be "listwise" for listwise deletion, or "pairwise" for pairwise deletion.

Value

An object of the class psychonetrics (psychonetrics-class)

Author(s)

Sacha Epskamp


psychonetrics documentation built on Oct. 26, 2021, 1:06 a.m.