Hi Statalist, I am new here but this forum is been helpful several times.
I am using stata15, and there's my problem:
I have a large amount of datasets, and I am looping them in order to produce kdensities and compare them. Each dataset has a different sample size.
I am entering the following command inside my loop:
kdensity variable, generate(x y) n() nograph
I am trying to find a way to put automatically the sample size inside the option n().
If I write:
count
kdensity variable, generate(x y) n(r(N)) nograph
stata says: option n() not allowed r(198);
It happens the same if I try to use a local with r(N)
How can I do? I would avoid to make them one-by-one
Related Posts with set n(#) in a kdensity loop with different sample sizes
Create a table with sectoral share valuesDear all, I am currently working with a dataset that contains information on quarterly gross value …
Endogeneity in non-structural modelingHello Stata users, Can you pleas tell me how we can adress endogeniety in non-structural modeling? …
Calculating Standard Deviation of the ResidualsHi all, I ran an ECM and after this, I want to inspect the Standard Deviation of the Residuals plot …
how to run a DEA meta frontière in stata?I want to implement a meta boundary model to take into account the specificity of each group in the …
How to check if variables in varlist are registered as regular or imputedI'm trying to write a loop that iterates through every single variable in a varlist and performs dif…
Subscribe to:
Post Comments (Atom)
0 Response to set n(#) in a kdensity loop with different sample sizes
Post a Comment