# How can I bootstrap pwcorr or pcorr with Stata?

I'm trying to use a Pearson's correlation with two non-normal variables. I know that I could use non-parametric correlation models such as Spearman's, but that would make the information more difficult to interpret. Can someone help me with a simple solution to apply bootstrapping to pwcorr and pcorr functions using Stata?

• – Nick Cox Dec 15 '15 at 23:35
• The "functions" you mention are commands in Stata terms. – Nick Cox Dec 16 '15 at 10:45
• There is a statistical question embedded here, which is addressed by @Dimitriy in his answer and also on Statalist. But without sight of the data or clarification of the supposed problem further comment is difficult, both here and there. – Nick Cox Dec 16 '15 at 10:49

On the statistical aspects of the question, I am not sure why Spearman would be more difficult to interpret or why normality is required here exactly. You may want to reconsider those opinions. Also, it is Stata, and not STATA.

On the computational part, with two variables, you can accomplish your goal like this:

sysuse auto
pwcorr price mpg
bootstrap corr = r(rho), nodots nowarn reps(1000) seed(1921) saving("~/DESKTOP/bs_corr", replace): pwcorr price mpg

• I edited the misspelling STATA in the original (not used by the company for 30 years; why is it a meme at all?). – Nick Cox Dec 16 '15 at 10:45
• @NickCox, I kind of have to blame their mixed cases in the logo that spells STaTa. – Penguin_Knight Dec 16 '15 at 13:39
• @Penguin_Knight Sure, the company kept the original logo in its idiosyncratic font; logos are often different because they are intended to be distinctive. But even a glance at the website or the documentation shows that Stata is the standard spelling. (Disclosure of interest is left tacit.) – Nick Cox Dec 16 '15 at 13:46
• @NickCox, well having been corrected once by you as well and now trying make my students spell it correctly, I feel your pain. :) – Penguin_Knight Dec 16 '15 at 13:49
• That's good to hear, but why do your students want to spell it incorrectly? Perhaps they see references to SPSS, SAS, etc. and somehow infer that all caps is the rule. – Nick Cox Dec 16 '15 at 13:52