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?
Using -cmp- to estimate and interpret a three-stage Heckman modelGood morning all, I am using the -cmp- package developed by Roodman to estimate a three-stage Heckm…
Foreach vs. Forvalues when using char() function to remove special characters in a string variableHello all, Using Stata 15.1/IC I need to submit a bulk file with a string variable ("NAME" variabl…
Standard errors using Frisch-Waugh-Lovell theoremHi, I need to implement the Frisch Waugh-Lovell-theorem in Stata 15 MP (64-bit) in the context of a …
Hyperlink to the file generated/modified by putexcelThis is a very minor request/question. Several of the user-made commands I use (e.g. estout, and ieb…
grouped variablesHi I currently have a variables for income following this structure: Therefore when I run summary s…
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