Learn R Programming

genpathmox (version 0.5)

invariance_test: Invariance Test

Description

The invariance test is a test that allows to verify the existence of common weights for the different local PLS-PM models identified by one or more segmentation variable.

Usage

invariance_test(x, nodes, inner, outer, mode, scheme, scaled)

Arguments

x

Matrix or data frame containing the manifest variables.

nodes

List of vectors. Each vector contains the position of the individual that belongs to a specific node.

inner

A square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables).

outer

list of vectors with column indices or column names from Data indicating the sets of manifest variables forming each block (i.e. which manifest variables correspond to each block).

mode

character vector indicating the type of measurement for each block. Possible values are: "A", "B", "newA", "PLScore", "PLScow". The length of mode must be equal to the length of outer.

scheme

string indicating the type of inner weighting scheme. Possible values are "centroid", "factorial", or "path".

scaled

whether manifest variables should be standardized. Only used when scaling = NULL. When (TRUE, data is scaled to standardized values (mean=0 and variance=1).

Value

An data.farme res. Basically a list with the following results:

chisq.statistic

A Number; X^2 statistic

p.value

A Number; p-value

dfH0

A Number; degree of freedom null Hypotheis

dfH1

A Number; degree of freedom alternative Hypotheis

avg.weights

data frame of the common weights if they exist

test

data frame with summry information of the invariance test

Details

The "x" refers to a matrix or a data.farme that contains all individuals used for the global PLS-PM estimation The "nodes" is a list of vectors. Each vector contains the position of the individual that belongs to a specific node. The position is idenfied by the number of row. For example, the row 4 corresponds to the individual 4 The other parameters are the classical parameter of the fucntion "plspm"

References

Lamberti, G., Banet, T. (2017) Invariance Test: Detecting Difference Between Latent Vari ables Structure in Partial Least Squares Path Modeling. International Journal of Statistics and Probability, 6(2); doi: 10.5539/ijsp.v6n2p54

Lamberti, G. (2014) Modeling with Heterogeneity. PhD Dissertation.

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
 ## example of PLS-PM in alumni satisfaction
 
 data(fibtele)

data.fib <-fibtele[,12:35]

 #define inner model matrix
 Image     	= rep(0,5)
 Qual.spec	  = rep(0,5)
 Qual.gen		= rep(0,5)
 Value			  = c(1,1,1,0,0)
 Satis			  = c(1,1,1,1,0)
 inner.fib = rbind(Image,Qual.spec, Qual.gen, Value, Satis)
 colnames(inner.fib) = rownames(inner.fib)

#define blocks of indicators (outer model)
outer.fib = list(1:8,9:11,12:16,17:20,21:24)

#efine de mode
modes.fib  = rep("A", 5)


seg.fib = fibtele[,2:11]

seg.fib$Age = factor(seg.fib$Age, ordered=TRUE)
seg.fib$Salary = factor(seg.fib$Salary, 
                       levels=c("<18k","25k","35k","45k",">45k"), ordered=TRUE)
seg.fib$Accgrade = factor(seg.fib$Accgrade, 
                          levels=c("accnote<7","7-8accnote","accnote>8"), ordered=TRUE)
seg.fib$Grade = factor(seg.fib$Grade, 
                       levels=c("<6.5note","6.5-7note","7-7.5note",">7.5note"), ordered=TRUE)

#pathmox Analysis
 fib.pathmox=pls.pathmox(data.fib, inner.fib, outer.fib, modes.fib,seg.fib,signif=0.05,
				deep=2,size=0.2,n.node=20)

#select the terminal nodes
ls(fib.pathmox)

terminal.nodes=fib.pathmox$terminal[-1] 

#Invariance test
inv.test=invariance_test(data.fib,terminal.nodes,inner.fib,
         outer.fib,modes.fib,scheme="centroid",scaled=FALSE)
inv.test
 
# }
# NOT RUN {
 ## example of PLS-PM in alumni satisfaction
 
 data(fibtele)

data.fib <-fibtele[,12:35]

#define inner model matrix
Image       = rep(0,5)
Qual.spec	 = rep(0,5)
Qual.gen		 = rep(0,5)
Value			 = c(1,1,1,0,0)
Satis		   = c(1,1,1,1,0)
inner.fib = rbind(Image,Qual.spec, Qual.gen, Value, Satis)
colnames(inner.fib) = rownames(inner.fib)

#define blocks of indicators (outer model)
outer.fib = list(1:8,9:11,12:16,17:20,21:24)

#efine de mode
modes.fib  = rep("A", 5)


seg.fib = fibtele[,2:11]

seg.fib$Age = factor(seg.fib$Age, ordered=TRUE)
seg.fib$Salary = factor(seg.fib$Salary, 
                       levels=c("<18k","25k","35k","45k",">45k"), ordered=TRUE)
seg.fib$Accgrade = factor(seg.fib$Accgrade, 
                          levels=c("accnote<7","7-8accnote","accnote>8"), ordered=TRUE)
seg.fib$Grade = factor(seg.fib$Grade, 
                       levels=c("<6.5note","6.5-7note","7-7.5note",">7.5note"), ordered=TRUE)

#pathmox Analysis
 fib.pathmox=pls.pathmox(data.fib, inner.fib, outer.fib, modes.fib,SVAR=seg.fib,signif=0.05,
				deep=2,size=0.2,n.node=20)
 
terminal.nodes=fib.pathmox$terminal[-1] 

#Invariance test
inv.test=invariance_test(data.fib,terminal.nodes,inner.fib,
         outer.fib,modes.fib,scheme="centroid",scaled=FALSE)




# }

Run the code above in your browser using DataLab