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
Counting different variable associated with one variableI have a list of patients who have pulmonary nodule treatment with three different types of embolic …
Market share of different firms in different regionsHI, I have a dataset of some firms which provide services to some clients in 10 different regions. H…
Means at a time intervalGood evening, I'm having a datset with age as the independent variable. Age is given as a point numb…
Displaying number of observations underneath twoway line plotsHello, I wonder if I could please get advice on how to display the number of observations underneat…
GSEM and Survey Weights IssuesHello, Thanks for giving this a look. First, I am working with the ELS:2002 restricted, so it is a …
Subscribe to:
Post Comments (Atom)
0 Response to Explaining output from replace command
Post a Comment