Hi everyone,
It seems like STATA skips over test1 and test2 observations as my new variables maxtest1 and maxtest2 are test3 observations. It seems like my forvalues m=1/3 is right. Please tell me what's wrong in the code. Thank you in advance.
local maxtest maxtest1 maxtest2 maxtest3
local i=1
foreach value of local maxtest {
gen `value'=.
forvalues m=1/3 {
replace `value'=test`m' if test1effort==`i'&test2effort==`i'&test3effort==`i'
}
}
Related Posts with Forvalues skip the first two observations
calculating distance in a loop using 'spdistance' in STATA 15Dear Statalisters I have shapefile containing information about the geographic coordinates of all t…
Geographical dataDear Statalist, I have a time series on road accidents that happened in a particular region. Each a…
Create a variable that is equal to 1 if "the below value" bigger than "the above value"Hello. I'd like to ask for help. I want to make goal, goal_pre, goal_post using by id and target. T…
Creating a custom atrisk table for a survival graphHi all, I want to create an atrisk table in a seperate graph, which i can then combine with a stand…
How to plot the difference between two marginsplot?Hi, I have two marginsplot for the same model for two different groups, but I would like to have a …
Subscribe to:
Post Comments (Atom)
0 Response to Forvalues skip the first two observations
Post a Comment