Monthly Archives: April 2018

R and Stata code for inverse covariance weighting

A previous post had discussed differences between dimension reduction through principal components and factor analysis on the one hand and inverse covariance weighting (ICW) on the other: [link].

Here is a link to a Stata .ado GitHub repository with the code for ICW index construction, including both an R example as well as a Stata .do file that loads a program to construct indices: [.git]. The .do file itself contains instructions on using the function “make_index_gr”, which generates an ICW index that can include weights and can be set to standardize with respect to any subset of the data (e.g., against the control group).

Please give them a try and if you find any bugs, please let me know. Also, if anyone wants to do a more professional job with the coding, and even integrate them into broader packages, please be my guest.


  • The make_index_gr Stata program was modified on 2018-05-03 so that the resulting index indeed centers on the standardization group.
  • Post was edited on 2018-05-04 to link to the GitHub repository.