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.