Dear all
-pwcorrf- is now available on SSC. It has three advantages over the standard pwcorr command.
Demo
Todo list
Comments, feedback, bug reports and so on are always welcome.
Jesse Wursten
KU Leuven
-pwcorrf- is now available on SSC. It has three advantages over the standard pwcorr command.
- It is much faster (often 10x or more)
- It can calculate within variable correlations. E.g. correlations across panel units. Before you'd have to reshape the data first, which was not always possible (variable limit) and very very slow.
- It returns the matrix r(T) which shows the number of observations used to calculate each pairwise correlation.
Demo
Code:
*** Correlation across variables sysuse citytemp.dta, clear pwcorrf heatdd cooldd tempjan tempjuly, showt qui replace heatdd = . if runiform() < 0.3 qui replace tempjan = . if runiform() < 0.8 pwcorrf heatdd cooldd tempjan tempjuly, showt *** Correlation within variables sysuse xtline1.dta, clear pwcorrf calories, reshape qui reshape wide calories, i(day) j(person) pwcorrf calories* pwcorr calories* *** Returns r(T) pwcorrf calories* return list pwcorr calories* return list
- return r(P), a matrix with the significance of each pairwise correlation
- return r(Pd), the same matrix with Dunnett's test-based p-values. Note that in my understanding, Bonferroni and Sidak corrections are not valid for pairwise correlations as they assume the tests are independent? I.e. different "control groups" for each correlation.
Comments, feedback, bug reports and so on are always welcome.
Jesse Wursten
KU Leuven
Comment