Learn R Programming

genpathmox (version 0.2)

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, scaling, 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".
scaling
optional list of string vectors indicating the type of measurement scale for each manifest variable specified in blocks. scaling must be specified when working with non-metric variables. Possible values: "num" (numer
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.statisticA Number; X^2 statistic
  • p.valueA Number; p-value
  • dfH0A Number; degree of freedom null Hypotheis
  • dfH1A Number; degree of freedom alternative Hypotheis
  • avg.weightsdata frame of the common weights if they exist
  • testdata 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. (2014) Modeling with Heterogeneity. PhD Dissertation.

Examples

Run this code
## example of PLS-PM in alumni satisfaction

 data(fibtele)

 # select manifest variables
 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)

 # blocks of indicators (outer model)
 outer.fib <- list(1:8,9:11,12:16,17:20,21:24)
 modes.fib  = rep("A", 5)

 # apply plspm
 pls.fib <- plspm(data.fib, inner.fib, outer.fib, modes.fib)


 # re-ordering those segmentation variables with ordinal scale
  seg.fib= fibtele[,2:11]

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

 # Pathmox Analysis
 fib.pathmox=pls.pathmox(pls.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

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

Run the code above in your browser using DataLab