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
Generating new variable by counting observationsHello Members, I have a data set (shown below). I want to generate a new variable that counts the n…
Stata for FE/RE modelsDear All, Consider the following standard estimation of FE (fixed-effect) and RE (random-effect) mod…
Age rangeDear all, I would like to know how to specify age range in Stata. My current value range is 25-100,…
Problem with Outreg2Hi, I wonder if the outreg2 command comes through an option that allows the coefficient and their se…
Splitting variable based on conditionDear all, I wonder if it is possible to split string variables containing numbers using 'split Vari…
Subscribe to:
Post Comments (Atom)
0 Response to set n(#) in a kdensity loop with different sample sizes
Post a Comment