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?
Panel Regression with a Moderator Variable*Please forgive my lack of Stata/Statistics knowledge or basic questions, I'm fairly new to Stata an…
running parmest on STATA 15Hi I was wondering if anyone could help me out a bit on the parmest command. I am using STATA 15 an…
Filtering quality variablesI am having s panel data on macro variables for 72 countries (I. e. ;gdp, inflation etc) and a conti…
Calculate number of "common friends" in the past five yearsDear fellow Statalisters, For a large panel data set on alliances, I want to calculate the number o…
Problem - Use 2 datasets in one do file (single run)Hi all ! I need help on stata I am trying to create one do file in Stata (mandatory) using 2 diff…
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