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
how to get foreach of varlist v1-v10 take every second variable from the specified set (v1 v3 v5...)?Hi dear Statalisters, I was wondering if there is any way to get Stata to pick every second variable…
Change of bootstrapping module/algorithm for Stata ver16?Dear Statalisters, I hope you have all been healthy and well. I have a question that may require th…
How to use percentile data and raw data?Hi everyone I have a question for you? The model I use has both percentage variables and raw data. A…
Importer-year and exporter-year fixed effects issues in gravity equation modelGood morning Statalist community, I am studying the determinants of asset trade flows across 40ish …
Inconsistent Behavior Between Mata Functions and Identical Class Methods Toward Object TypesThis is occasioned by a thread begun by Alfonso Sánchez-Peñalver here. It’s been a while since I’ve…
Subscribe to:
Post Comments (Atom)
0 Response to set n(#) in a kdensity loop with different sample sizes
Post a Comment