Package 'coefa'

Title: Meta Analysis of Factor Analysis Based on CO-Occurrence Matrices
Description: Provide a series of functions to conduct a meta analysis of factor analysis based on co-occurrence matrices. The tool can be used to solve the factor structure (i.e. inner structure of a construct, or scale) debate in several disciplines, such as psychology, psychiatry, management, education so on. References: Shafer (2005) <doi:10.1037/1040-3590.17.3.324>; Shafer (2006) <doi:10.1002/jclp.20213>; Loeber and Schmaling (1985) <doi:10.1007/BF00910652>.
Authors: Xijian Zheng [aut, cre], Huiyong Fan [aut]
Maintainer: Xijian Zheng <[email protected]>
License: GPL (>= 3)
Version: 1.0.3
Built: 2024-10-31 03:19:51 UTC
Source: https://github.com/cran/coefa

Help Index


Meta Analysis of Factor Analysis Based on Co-occurrence Matrices

Description

It is used to conduct Meta Analysis of Factor Analysis based on Co-occurrence Matrices, which employs several functions to read files, calculate the co occurrence matrix, and finish the exploratory factor analysis.


Aggregate co-occurrence matrices

Description

This function is used to aggregate those co-occurrence matrices to form an overall(pooled) co-occurrence matrix.The users can get two kinds of aggregated (i.e. pooled) co-occurrence matrices: the non-weighted aggregated co-occurrence matrix, and the weighted aggregated co-occurrence matrix. And the users can make their choices through the setting of corresponding parameters.

Usage

coefa_acm(x,sz,samplesized =c(TRUE,FALSE),raw=FALSE)

Arguments

x

A list containing multiple co-occurrence matrices.

sz

A vector containing multiple sample sized of original study. The elements of the vector should be in the same order as the original study, that is, the first element is the sample size of the first original study, and the second element is the sample size of the second original study....

samplesized

A logical value is used to select the weighting method. If "samplesized"=TRUE, the final aggregated co-occurrence matrix will be obtained by weighting the sample size. If "samplesized"=FALSE, the size of the sample size is not considered in the process of summarizing the co-occurrence matrix, that is, the co-occurrence matrix is added and divided by the number of matrices.

raw

A logical value.If raw=TRUE,Raw co-occurrence matrix and similarity matrix will be obtained. If raw=FALSE(The default value is FALSE),only similarity matrix will be obtained.

Value

A matrix formed by adding all the co-occurrence matrices,or adding them after weighting by sample size.

References

Shafer,A. B.(2005). Meta-analysis of the Brief Psychiatric Rating Scale factor structure. Psychological Assessment, 17(3),324–335.

Shafer,A. B. (2006). Meta-analysis of the factor structures of four depression questionnaires: Beck, CES-D, Hamilton, and Zung. Journal of clinical psychology, 62(1), 123–146.

Examples

#Suppose that matrices.gcm is the co-ocurrence matrices.
##Note:This is just an example.
##The real co-occurrence matrix should be generated from actual studies.
mx1.tflm<-matrix(c(1,0,0,1,1,0),nrow=2,byrow=2)
mx2.tflm<-matrix(c(1,0,0,1),nrow=2,byrow=2)
matrices.tflm<-list(mx1.tflm,mx2.tflm)
matrices.gcm<-coefa_gcm(matrices.tflm)
#Import a sample size collection containing the original study.
sz<-c(100,200)
#Aggregate multiple co-occurrence matrices.
matrices.acm<-coefa_acm(matrices.gcm,sz,samplesized = TRUE)
matrices.acm

PCA and EFA

Description

Choosing an appropriate method to extract factor from the aggregated co-occurrence matrix.

Usage

coefa_fa(R, nfactors, methodcoefa, rotate, fm)

Arguments

R

a matrix. R is the pooled co-occurrence matrix obtained from the last step.

nfactors

Number of factors could be extracted.

methodcoefa

The method choosing factor model(i.e.PCA or EFA)."PCA" is principal component analysis,"EFA" is exploratory factor analysis.

rotate

The rotate parameter has many options to be chosen. They are: "none", "varimax", "quartimax", "bentlerT", "equamax", "varimin", "geominT" and "bifactor" are orthogonal rotations. "Promax", "promax", "oblimin", "simplimax", "bentlerQ, "geominQ" and "biquartimin" and "cluster".According to Shafer (2005, 2006), the only correct choice is “varimax”, because the aggregated co-occurrence matrix is different from a correlation matrix or a covariance matrix in essence. The default is to do a oblimin transformation.

fm

This parameter also has many options.When fm="minres", it will do a minimum residual, as will fm="uls". Both of them use a first derivative. What should be noted is that the fm="uls" is recommend by experts because it don’t request the normality and positive as two prerequisites.The fm="ols" differs very slightly from "minres" in that it minimizes the entire residual matrix using an OLS procedure but uses the empirical first derivative. This will be slower.The fm="wls" will do a weighted least squares (WLS) solution; the fm="gls" does a generalized weighted least squares (GLS); and the fm="pa" will do the principal factor solution, fm="ml" will do a maximum likelihood factor analysis. The fm="minchi" will minimize the sample size weighted chi square when treating pairwise correlations with different number of subjects per pair. The fm ="minrank" will do a minimum rank factor analysis. The "old.min" will do minimal residual the way it was done prior to April, 2017. The fm="alpha" will starts an alpha factor analysis as described in Kaiser and Coffey (1965).

Details

It should be noted that we should be alert to the positive definiteness of the aggregated matrix. If the matrix is non-positive definite, we should choose the factor extraction method carefully or we should take other solutions (remove questions appropriately, or smooth the matrix).

Value

a data frame

Examples

#Choosing EFA method to extract factor.
coefa_fa(matrices_acm,nfactors=6,methodcoefa="EFA",rotate="varimax",fm="ml")

Fix(Replace) the diagonal values in the matrix

Description

The diagonal of the matrix is replaced by 1 ,so that the matrix can be tested for KMO and Bartlett's test.

Usage

coefa_fixdia(x,test=FALSE,sz)

Arguments

x

A matrix that needs to replace the value of the diagonal in matrix.

test

A logical value.If test=TRUE,KMO and Bartlett's test will be done.

sz

The total sample sizes of include studies.

Details

The diagonal of the similarity matrix will be adjusted by this function, COEFA results will be more accurate, and KMO and Bartlett' Test tests can be carried out.

If test=FALSE,you will obtain a more accurate result without KMO and Bartlett's test. If test= TRUE ,you would obtain a result containing KMO and Bartlett's Test ,similarity matrix fixed.

Value

A matrix or a list containing KMO and Bartlett's test.

Examples

#similarity matrix——matrices_acm
fixedsmatrix<-coefa_fixdia(matrices_acm,sz=100)

Generate co-occurrence matrices

Description

The co-occurrence matrices are generated by this function. This function can be used obtain the co-occurrence matrix for each primary study.

Usage

coefa_gcm(x, ...)

Arguments

x

A list containing multiple trimmed factor loading matrices

...

Additional parameters which generate the co-occurrence matrices.

Details

The meta-analysts can use this function to obtain the co-occurrence matrix for each primary study. And the algorithm is that a trimmed factor loading matrix multiplies its transpose in the list. As a result, the number of the dimension of the matrix obtained in this step equates with that of the items included in a scale. In this new matrix, the values on the cross-cells indicate the clusters of the items. The greater the value in the cross-cells of a co-occurrence matrix, the bigger the degree of similarity between paired items.

Value

A list containing multiple co-occurrence matrices.

References

Shafer,A. B.(2005). Meta-analysis of the Brief Psychiatric Rating Scale factor structure. Psychological Assessment, 17(3),324–335.

Shafer,A. B. (2006). Meta-analysis of the factor structures of four depression questionnaires: Beck, CES-D, Hamilton, and Zung. Journal of clinical psychology, 62(1), 123–146.

Examples

#Suppose that the matrices.tflm is the factor loading matrices trimmed.
#Note:This is just an example.
#The real co-occurrence matrix should be generated from actual studies.
mx1.tflm<-matrix(c(1,0,0,1,1,0),nrow=2,byrow=2)
mx2.tflm<-matrix(c(1,0,0,1),nrow=2,byrow=2)
matrices.tflm<-list(mx1.tflm,mx2.tflm)
#Generate co-occurrence matrices.
matrices.gcm<-coefa_gcm(matrices.tflm)

Obtain the factor loading matrices in the original study and delete Na value

Description

The data containing xlsx files(or txt files,or csv files)in the given path will be extracted by this function and imported into R.These data files are stored as a list in which the matrices in each file is stored in order(the order in which the files are displayed in the folder).In this step,the missing values of factor loading matrices from the original study stored in multiple xlsx files will be set the value of 0.

Usage

coefa_read(type=c("xlsx","txt","csv"),manual=FALSE)

Arguments

type

File type to extract

manual

The way to read the data.

Details

This function is mainly used to read xlsx files from a folder into R. In this process,the missing values in the xlsx files(or txt file,or csv files) will be set to 0.The options of the "type" parameter can be "xlsx", "txt", "csv".It should be noted that the folder containing data files should be in current workspace.If it is not in the current workspace, the setwd() function needs to be used to set its path.An important point is that all files in your folder should use the same format, for instance, all of them are the xlsx files(or txt files,or csv files).

The default "manual" parameter of this function is FALSE.When the "manual" is TRUE, the function will not automatically read files. you will need to choose other ways to manually input the data and put them in a list to ensure that the subsequent functions of 'coefa' can work. You can get more information about functions in the readme and vignettes in this package.

Value

a list containing all factor loading matrices without NA.

Examples

#The following only shows a case of manual reading.
#we recommend coefa_read(type="xlsx",manual=FALSE).
#You can get more information about functions in the readme and vignettes of this package.
coefa_read(manual=TRUE)

Summary

Description

The function coefa_summary provides a preliminary preparation and suggestion for the later factor analysis using the aggregated co-occurrence matrix. And the results, the scree plot and Kaiser's criterion will be plotted by this function.

Usage

coefa_summary(object,fa,omitWarning=FALSE)

Arguments

object

A matrix of aggregated co-occurrence matrix.

fa

The method of extract factor for aggregated co-occurrence matrix. Principal components (fa="pc"),principal axis factor analysis (fa="fa),or both of them could be choose.

omitWarning

The default is not to omit warning.If omitWarning is default, suggestions(Scree plot and Kaiser's criterion, parallel analysis) for subsequent factor analysis will not be provided when the matrix is not positive definite.If omitWarning=TRUE,warning will be skipped and suggestions will be forced.

Details

It should be noted that we should be alert to the positive definiteness of the aggregated matrix. If the matrix is non-positive definite, we should choose the factor extraction method carefully or we should take other solutions (remove questions appropriately, or smooth the matrix).

Value

A list containing the matrix cases produced by each process of coefa.

References

Cao,Y., & Zhang, Y. (2017). Multivariate statistic methods in psychology and education. Beijing: Peking university press.158.

Examples

#summary
coefa_summary(matrices_acm,fa="fa")

Trimming factor loading matrices

Description

The original factor loading matrices after removing nulls will be trimmed through this function.At the end all the matrices only have two elements,0 or 1.

Usage

coefa_tflm(x,methodE=c("s","ls"),cutoff=c(0.3,0.4,0.5))

Arguments

x

A list of multiple original factor loading matrices included without NA.

methodE

The methods for trimming multiple factor loading matrices from the original study."s" and "ls" are two methods of trimming the original factor loading matrix, which are widely used in coefa studies.The s = Shafer’s(2005) method; ls = the Loeber and Schmaling’s method(1985).

cutoff

The Criteria for trimming factor loadings matrices. When greater than the cutoff value, a factor loading is assigned as 1; otherwise, it assigned as 0. And the cutoff value can be given as 0.3, or 0.4, or 0.5.

Details

This function is mainly used to discard the intensity information of the original factor loading matrices and to retain the direction information which make it into binary data.

During the coefa trimming process,the strength information of the factor loading matrices are given up,and the direction information is preserved. "s" and "ls" are two different methods in the coefa study.

If method="s", the factor loading matrices will be trimmed using the Shafer's(2005)method, that is, only the highest salient loadings of each variable in each factor are retained. If method="ls", the factor loading matrices will be trimmed using the Loeber and Schmaling's (1985) method,all insignificant factor loadings will be valued as 0.

Cutoff is just some fixed criterion for trimming the factor loading matrix. For example:if cutoff=0.3,elements in the factor loading matrix greater than 0.3 will be given the value of 1,and elements less than 0.3 will be replaced with 0.

Value

A list contained those trimmed factor loading matrices.

References

Loeber,R., & Schmaling, K. B. (1985). Empirical evidence for overt and covert patterns of antisocial conduct problems: a metaanalysis. Journal of abnormal child psychology, 13(2), 337–353.

Shafer,A. B.(2005). Meta-analysis of the Brief Psychiatric Rating Scale factor structure. Psychological Assessment, 17(3),324–335.

Shafer,A. B. (2006). Meta-analysis of the factor structures of four depression questionnaires: Beck, CES-D, Hamilton, and Zung. Journal of clinical psychology, 62(1), 123–146.

Examples

mx1<-matrix(c(0.1,0.2,0.3,0.4),nrow=2)
mx2<-matrix(c(0.4,0.3,0.2,0.1),nrow=2)
list1<-list(mx1,mx2)
#Trim matrices using the Shafer's method ,cutoff is 0.3.
matrices.tflm<-coefa_tflm(list1,methodE="s",cutoff=0.3)

Trimming factor loading matrices(The cutoff range can be selected(0~1))

Description

The function can provide the same effect as the coefa_tflm().The difference is that its cutoff value has a more flexible optional range (0~1).It should be noted that the flexible cutoff selection range may cause some problems. coefa_tflm() is recommended for stable performance

Usage

coefa_tflm2(x, methodE = c("s", "ls"), cutoff)

Arguments

x

A list of multiple original factor loading matrices included without NA.

methodE

The methods for trimming multiple factor loading matrices from the original study."s" and "ls" are two methods of trimming the original factor loading matrix, which are widely used in coefa studies.The s = Shafer’s(2005) method; ls = the Loeber and Schmaling’s method(1985).

cutoff

The Criteria for trimming factor loadings matrices.

Value

A list contained those trimmed factor loading matrices.

References

Loeber,R., & Schmaling, K. B. (1985). Empirical evidence for overt and covert patterns of antisocial conduct problems: a metaanalysis. Journal of abnormal child psychology, 13(2), 337–353.

Shafer,A. B.(2005). Meta-analysis of the Brief Psychiatric Rating Scale factor structure. Psychological Assessment, 17(3),324–335.

Shafer,A. B. (2006). Meta-analysis of the factor structures of four depression questionnaires: Beck, CES-D, Hamilton, and Zung. Journal of clinical psychology, 62(1), 123–146.

Examples

mx1<-matrix(c(0.1,0.2,0.3,0.4),nrow=2)
mx2<-matrix(c(0.4,0.3,0.2,0.1),nrow=2)
list1<-list(mx1,mx2)
#Trim matrices using the Shafer's method ,cutoff is 0.4.
matrices.tflm<-coefa_tflm2(list1,methodE="s",cutoff=0.4)

The aggregated co-occurrence matrix

Description

The aggregated co-occurrence matrix conducted by using coefa.

Usage

data(matrices_acm)

Format

A matrix

item

items of scale

item

items of scale

...

References

Agboeze, M.U.,Ugwuanyi,C.S.,& Okeke,C.(2021).Psychometric properties of spence children's anxiety scale in nigerian primary schools: implication for community development. International Journal of Psychosocial Rehabilitation, 25(1), 564-574.

Ahlen,J.,Vigerland,S.,& Ghaderi,A.(2018).Development of the spence children's anxiety scale short version(scas-s).Springer US(2).

Direktr,C.,& Serin,N.B.(2017).Psychometric properties of spence children's anxiety scale(scas).Eurasia Journal of Mathematics Science and Technology Education,13(10),6625-6636.

Glod,M.,Creswell,C.,Waite,P.,Jamieson,R.,Mcconachie,H., & Don South, M. , et al. (2017). Comparisons of the factor structure and measurement invariance of the spence children's anxiety scale—parent version in children with autism spectrum disorder and typically developing anxious children. Journal of Autism and Developmental Disorders, 47(12), 3834-3846.

Magiati, I. ,Lerh, J. W. , Hollocks, M. J. , Uljarevic, M. , Rodgers, J. , & Mcconachie, H. , et al.(2017). The measurement properties of the spence children's anxiety scale‐parent version in a large international pooled sample of young people with autism spectrum disorder. Autism Research Official Journal of the International Society for Autism Research,10.

Mellon Robert C & Moutavelis Adrianos G.(2007).Structure, developmental course, and correlates of children's anxiety disorder-related behavior in a Hellenic community sample.. Journal of anxiety disorders(1).

Muris, P., Schmidt, H., Engelbrecht, P., & Perold, M. (2002). DSM-IV-defined anxiety disorder symptoms in South African children. Journal of the American Academy of Child and Adolescent Psychiatry, 41(11), 1360–1368.

Examples

data(matrices_acm)

The factor loading matrices of 8 exploratory factor analysis for spence children anxiety scale(SCAS).

Description

A dataset containing 8 exploratory factor analysis from for spence children anxiety scale(SCAS).

Usage

data(spence8)

Format

A data list with 8 list of factor loading matrices.

name

The name of reaserches

factor

The numeber of factor

item

items of scale

...

References

Agboeze, M.U.,Ugwuanyi,C.S.,& Okeke,C.(2021).Psychometric properties of spence children's anxiety scale in nigerian primary schools: implication for community development. International Journal of Psychosocial Rehabilitation, 25(1), 564-574.

Ahlen,J.,Vigerland,S.,& Ghaderi,A.(2018).Development of the spence children's anxiety scale short version(scas-s).Springer US(2).

Direktr,C.,& Serin,N.B.(2017).Psychometric properties of spence children's anxiety scale(scas).Eurasia Journal of Mathematics Science and Technology Education,13(10),6625-6636.

Glod,M.,Creswell,C.,Waite,P.,Jamieson,R.,Mcconachie,H., & Don South, M. , et al. (2017). Comparisons of the factor structure and measurement invariance of the spence children's anxiety scale—parent version in children with autism spectrum disorder and typically developing anxious children. Journal of Autism and Developmental Disorders, 47(12), 3834-3846.

Magiati, I. ,Lerh, J. W. , Hollocks, M. J. , Uljarevic, M. , Rodgers, J. , & Mcconachie, H. , et al.(2017). The measurement properties of the spence children's anxiety scale‐parent version in a large international pooled sample of young people with autism spectrum disorder. Autism Research Official Journal of the International Society for Autism Research,10.

Mellon Robert C & Moutavelis Adrianos G.(2007).Structure, developmental course, and correlates of children's anxiety disorder-related behavior in a Hellenic community sample.. Journal of anxiety disorders(1).

Muris, P., Schmidt, H., Engelbrecht, P., & Perold, M. (2002). DSM-IV-defined anxiety disorder symptoms in South African children. Journal of the American Academy of Child and Adolescent Psychiatry, 41(11), 1360–1368.

Examples

data(spence8)