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
Regressing an interaction of two independent variables, of which one should get lower and one higher, on a dependent variableHi everyone! I want to perform a linear regression with two interacting independent variables but I…
(I NEED HELP) How to manually compute generalized residuals and score for a right-censored Tobit model?Hello, Statalist fellows! I'm finishing my bachelor's thesis, in which I'm running a right-censored…
Interpretation of Adjusted Predictions Contrasts (Margins command)Dear Statalist, I am new to the Margins command and would really appreciate some help with interpre…
Meta Analysis for one group - no control group.Hi all, I am conducting a systematic review and meta analysis that will investigate health-related …
HP filter panel dataHello, I am PhD student and I am new to stata. I am trying to create an hp trend for variable TourPr…
Subscribe to:
Post Comments (Atom)
0 Response to Explaining output from replace command
Post a Comment