Learn R Programming

lavaSearch2 (version 1.0.0)

checkData: Check that Validity of the Dataset

Description

Check the validity of the dataset used to estimate a lvm.

Usage

checkData(x, data, trace)

# S3 method for lvm checkData(x, data, trace = TRUE)

Arguments

x

a lvm model

data

the dataset containing the variables used to estimate the lvm.

trace

[logical] should a message be output to indicate the outcome of the check?

Examples

Run this code
# NOT RUN {
m <- lvm()
regression(m) <- c(y1,y2,y3)~u
regression(m) <- u~x
latent(m) <- ~u

d <- sim(m,1e2)

try(checkData(m, d)) # return an error

checkData(m, d[,-4])

try(checkData(m, d[,-(3:4)])) # return an error

# }

Run the code above in your browser using DataLab