Hi All,
I have some code that I have frequently pasted into various .do files. Instead; I would like to create a standalone program and add it to stata in the same way I would from ssc. However, I am having problems defining the arguments for the program.
I would like to have the following code:
corrstat JP_large JP_med, null(0.9)
Run the program (correlates JP_large, JP_med and gives me p-value under null that rho=0.9)
I believe the error lies in the very first part and so have included the beginning snippet:
"“
program define corrstat
syntax varlist, [null(real 0)] [location(string "$matrix")] [name(string "DEFAULT")]
preserve
* keep only the concerned variables
keep `varlist'
* number of variables
desc
local varnum=`r(k)'
…” "
I have some code that I have frequently pasted into various .do files. Instead; I would like to create a standalone program and add it to stata in the same way I would from ssc. However, I am having problems defining the arguments for the program.
I would like to have the following code:
corrstat JP_large JP_med, null(0.9)
Run the program (correlates JP_large, JP_med and gives me p-value under null that rho=0.9)
I believe the error lies in the very first part and so have included the beginning snippet:
"“
program define corrstat
syntax varlist, [null(real 0)] [location(string "$matrix")] [name(string "DEFAULT")]
preserve
* keep only the concerned variables
keep `varlist'
* number of variables
desc
local varnum=`r(k)'
…” "
Comment