Cross correlations with p-values (STB-13: sts3) -------------------------------- Under version 5.0: ^xcorr^ var1 var2 [^if in^ , ^l^ags(#) {^k^endall | ^p^earson | ^s^pearman} ] Under version 6.0: ^bl_xcorr^ var1 var2 [^if in^ , ^l^ags(#) {^k^endall | ^p^earson | ^s^pearman} ] calculates cross correlations--that is, correlations at various lags--of var1 and var2. By default, Pearson correlations are calculated. p-values are displayed along with the correlation coefficients. Version control --------------- In order to handle the naming conflict between this command and the new Stata 6 time-series command ^xcorr^, the Stata 6 ^xcorr^ command resolves the conflict using version control. For example, the Becketti library command ^xcorr^ may be invoked as follows in Stata 6: . ^version 5.0^ . ^xcorr x1 x2, lags(3) k Alternatively, you can access this command directly using its new name: . ^bl_xcorr x1 x2, lags(3) k^ Options ------- ^l^ags(#) specifies the number of lagged cross-correlations to display. ^k^endall | ^p^earson | ^s^pearman indicates which correlation coefficient to calculate. The default is ^p^earson. Saved results ------------- ^xcorr^ saves its results in the system macros S_1, ... : ^S_1^ Correlation between var1 and var2 ^S_2^ p-value of correlation between var1 and var2 ^S_3^ Correlation between L.var1 and var2 ^S_4^ p-value of correlation between L.var1 and var2 ^S_5^ Correlation between var1 and L.var2 ^S_6^ p-value of correlation between var1 and L.var2 . . . Note ---- ^xcorr^ calls the programs ^lag^, ^period^, and ^_ts_peri^ supplied in sts2 (STB-7) and the programs ^pearson^ and ^spear^ supplied in sg5.1 (STB-13). These programs must be in the ado path specified by S_ADO for ^xcorr^ to execute. Author ------ Sean Becketti, Stata Technical Bulletin Also see -------- STB: ^sts3 (STB-13)^ Manual: ^[R] xcorr^ On-line: help for @xcorr@