generation.QoLSEM: Generation dataset from a QoLSEM model

View source: R/generation.QoLSEM.R

generation.QoLSEMR Documentation

Generation dataset from a QoLSEM model

Description

This function is used to generate dataset(s) from the model proposed by Barbieri, Tami et al. (2018). It is used to propose an example to the users.

Usage

generation.QoLSEM(N = 500, I = 150, c = as.matrix(c(2, -2)),
  a1 = c(1:7), a2 = c(1:12), d = as.matrix(c(80)),
  D1 = matrix(seq(0:14, 2) + 70, ncol = 7), D2 = matrix(seq(0:24, 2) +
  20, ncol = 12), sigma.y = 10, sigma.X1 = 10, sigma.X2 = 10)

Arguments

N

number of dataset to generate

I

number of observations (statistic units) by datasets; a pair number are expected

c

a numerical vector denoting the two scalars c=[c1,c2]: parameters associated with the two factors to explain the response varaible Y

a1

a numerical vector (of size q_1) of parameters associated with the factor f_1

a2

a numerical vector (of size q_2) of parameters associated with the factor f_2

d

vector of explanatory variables associated with y

D1

matrix of parameters associated with the block 1

D2

matrix of parameters associated with the block 2

sigma.y

standard deviation of the response variable y

sigma.X1

average standard deviation of the block 1

sigma.X2

average standard deviation of the block 2

Value

A dataframe for N>1 and a list for N=1

Author(s)

Antoine Barbieri, Myriam Tami

References

Barbieri A, Tami M, Bry X, Azria D, Gourgou S, Mollevi C, Lavergne C. (2018) EM algorithm estimation of a structural equation model for the longitudinal study of the quality of life. Statistics in Medicine. 37(6) :1031-1046.

Examples

## test avec N=1
test1 <- generation.QoLSEM(N=1,I=150,
                           c=as.matrix(c(2,-2)),
                           a1=matrix(c(1:7),nrow=7),
                           a2=matrix(c(1:12),nrow=12),
                           d=c(80),
                           D1=matrix(seq(2,14,2)+70,ncol=7),
                           D2=matrix(seq(2,24,2)+20,ncol=12),
                           sigma.y=10,sigma.X1=10,sigma.X2=10)

## test avec N>1
test20 <- generation.QoLSEM(N=20,I=150,
                            c=as.matrix(c(2,-2)),
                            a1=matrix(c(1:7),nrow=7),
                            a2=matrix(c(1:12),nrow=12),
                            d=c(80),
                            D1=matrix(seq(2,14,2)+70,ncol=7),
                            D2=matrix(seq(2,24,2)+20,ncol=12),
                            sigma.y=10,sigma.X1=7,sigma.X2=5)


AntoineBbi/QoLSEM documentation built on May 10, 2022, 6:07 a.m.