Hi everybody:
I can't find a way of creating a sub correlation matrix from a bigger one: I need to eliminate a row (and the corresponding column), in order to create a smaller correlation matrix that excludes specifically one variable.
A bit of context: using code that Joseph Coveney posted time ago to compute ordinal alphas (Zumbo et al. Journal of Modern Applied Statistical Methods 2007) I wrote a tiny rclass command called ordalpha that reads a list of variable names, computes the polychoric correlation matrix, computes ordinal alpha and stores its value in r(ordalpha) (just to be able to get a 95%CI using bootstrap). Now I have been asked to compute also the alpha coefficients for each item when that item is removed from the scale. Since the scale I was studying has 32 items, it means I have to write 32 statements like this:
ordalpha das2-das32
ordalpha das das3-das32
ordalpha das1-das2 das4-das32
And so on until
ordalpha das1-das31
The dataset has many cases, and the time needed to compute the polychoric matrix each time is several minutes (Stata 12.1 SE 64 bits). I have been trying to find a way to use a loop that at each run creates a correlation matrix that eliminates one row (and the corresponding column) from the original one and computes ordinal alpha without that variable. This way, the bottleneck of the process (computing the polychoric correlation matrix) would be done just once (instead of 32 times).
I have downloaded -matselrc-, but I can't figure how to use it to eliminate one row/column, since it works the other way around (creates a matrix with the rows/columns indicated by the user).
Thanks a lot in advance,
Marta GG
I can't find a way of creating a sub correlation matrix from a bigger one: I need to eliminate a row (and the corresponding column), in order to create a smaller correlation matrix that excludes specifically one variable.
A bit of context: using code that Joseph Coveney posted time ago to compute ordinal alphas (Zumbo et al. Journal of Modern Applied Statistical Methods 2007) I wrote a tiny rclass command called ordalpha that reads a list of variable names, computes the polychoric correlation matrix, computes ordinal alpha and stores its value in r(ordalpha) (just to be able to get a 95%CI using bootstrap). Now I have been asked to compute also the alpha coefficients for each item when that item is removed from the scale. Since the scale I was studying has 32 items, it means I have to write 32 statements like this:
ordalpha das2-das32
ordalpha das das3-das32
ordalpha das1-das2 das4-das32
And so on until
ordalpha das1-das31
The dataset has many cases, and the time needed to compute the polychoric matrix each time is several minutes (Stata 12.1 SE 64 bits). I have been trying to find a way to use a loop that at each run creates a correlation matrix that eliminates one row (and the corresponding column) from the original one and computes ordinal alpha without that variable. This way, the bottleneck of the process (computing the polychoric correlation matrix) would be done just once (instead of 32 times).
I have downloaded -matselrc-, but I can't figure how to use it to eliminate one row/column, since it works the other way around (creates a matrix with the rows/columns indicated by the user).
Thanks a lot in advance,
Marta GG
Comment