This uses the "sysuse auto" stata dataset.
The command I was intending to type was
replace price=10 if _n==50
However, I mistakenly typed the syntax
replace price if _n=50
This second command changed the value of price to 50 for all 74 rows of the dataset.
I was hoping someone could explain the logic behind this. It wasn't something I would have expected had I just seen the code.
Thanks,
Peter.
Related Posts with Explaining output from replace command
Sample size & power for quantile regressionHello, For a clinical trial using quantile regression to test the null hypothesis, could anyone adv…
Three-level mix-effect model for ordered logistic regression in Stata- meologit regressionDear all, I am currently working with a cluster data collected from 3229 respondents in 40 counties…
Correlation PbHello, I am pretty new to Stata and econometrics in general so please excuse me if my question seem…
Predictions with and without BLUP after melogitI am attempting to calculate predictions after a melogit model with and without best linear unbiased…
Composite IndexHi! I am trying to generate a composite index for 2 numerical variables. what is the best way to do …
Subscribe to:
Post Comments (Atom)
0 Response to Explaining output from replace command
Post a Comment