Hi Fellow Listers,
I am trying to generate a sequence of values based on a numlist from 1 to X in a non-integer increment such as 1(0.0001)10.
The code below does this okay, but I am not sure if there is a better approach to setting the observations (here I arbitrarily set obs to 100000).
Any help would be much appreciated!
qui {
set obs 100000
local cnt = 1
gen test =.
forval i = 1(0.0001)10 {
replace test = `i' in `cnt'
local cnt = `cnt' + 1
}
}
Ariel
Related Posts with best way to "set obs" when the number of obs is not clearly known?
Double selection lassoDear statalist, I have attempted a logit regression and now I need to attempt a double selection la…
Question on Intraclass correlation coefficients (ICC): two-way mixed effectsHi! I wish to use ICC to look at test-retest reliability using two sets of data reported by the same…
Rename from last part of label that includes "."Hello! I'm trying to rename variables from the label, but this label includes dots (".") Example La…
fixed effects and constant estimatesDear All, Does anyone know the relationship among the following commands? I mean how can we adjust t…
Count by groups 5 years after the current yearDear Statalist, I am wondering if you can help me to count the number of times a given attribute is …
Subscribe to:
Post Comments (Atom)
0 Response to best way to "set obs" when the number of obs is not clearly known?
Post a Comment