Hi
2 Questions -
1) I was wondering if anyone had advice on how to learn to define programs in Stata. Are there any resources you could point me towards?
2) I want to define a program on Stata but I am not sure if it is possible so please forgive me if what I am asking is nonsense. I would like to create a Stata program that would help provide descriptive statistics with just one line of code. For example
cap program drop descstat
program define descstat, rclass
version 13.0
syntax tab(varlist) codebook(varlist) sum(varlist) table(varlist)
tab1 `tab', m
sum `sum'
codebook `codebook'
table `table'
end
(Let's assume we use sysuse auto.dta) The command I would like to enter is
descstat tab(foreign make) sum(price-weight) codebook(rep78) table(foreign rep78)
The code above does not work (obviously), but I inserted it to give you an idea of what I am trying to achieve. I want to create a program that would provide the tab of the specific variables i list within the "(varlist)", sum of the variables and codebook of the variables that I specify.....Is this possible?
Thanks,
Related Posts with Defining Program Stata Help
bootstrap likelihood ratio OR Lo-Mendell-Rubin adjusted likelihood ratio testDear Statalisters, Please I am looking for your help to obtain the syntax in order to calculate boo…
Using only end of month values for a daily dataset?Hey I have a dataset in this format: Date(daily) var1 var2 var3 var4 var5 I only want to work wit…
Using rsens for sensitivity analysis after PSM Hi everyone, Just looking for some help carrying out a sensitivity analysis after psm. After carry…
Different results xtmelogit vs. melogitDear all, This is my first post. I read the FAQ and I hope I am not breaking the rules. Here are t…
Replacing missing values with the mean by group via a loopHello, I have a large dataset of 59,000,000 observations. There are a 50 variables each beginning …
Subscribe to:
Post Comments (Atom)
0 Response to Defining Program Stata Help
Post a Comment