I was trying to use the -if- condition to specify my regressions, and at first I did reg y x if dummy==0 and reg y x if dummy==1. I wanted to shorten my code so I tried the -if- command: if dummy==0 {reg y x} and if dummy==1 {reg y x}. The first problem I ran into was that the second if command wouldn't run: Stata didn't return any errors but no results showed up. I then changed the second -if- to -else- but the same thing happened, no errors and no results. While trying to identify what exactly went wrong, I switched the order of my specifications & used a simple command like displaying summary statistics, but the problem is always this: the -if- command concerning the same variable run after the first one does not work.
There is also one other question: I get different regression results when using the -if- condition and the -if- command. I saw a similar question with using -keep- and the -if- condition, but it didn't seem to have happened with anyone else. What could be the reason for this?
There is also one other question: I get different regression results when using the -if- condition and the -if- command. I saw a similar question with using -keep- and the -if- condition, but it didn't seem to have happened with anyone else. What could be the reason for this?
Comment