trailloha.blogg.se

Regress x on y stata
Regress x on y stata






regress x on y stata

#Regress x on y stata how to

In this guide I will show how to do a regression analysis with control variables in Stata. Had there been a relationship between height and speed even under control for gender, this would still not have implied that the relationship was causal, but it would at least have made it more less unlikely. And if we actually run this analysis (which I have!) we will see that no relationship between height and time remains. What we are looking at is whether tall women run faster than short women, and whether tall men run faster than short men. To "control" for the variable gender in principle means that we compare men with men, and women with women. If we don't account for the runners' gender, we would not pick that up. On average, men are taller than women, and they also have other physiological properties that make them run faster. If this was a causal relationship - for instance because you can run faster if you have long legs - we could encourage tall youth to get into track and field.īut it would be unwise, without taking other relevant variables into account variables that can affect both height and running speed.

regress x on y stata

It is actually a quite strong relationship. We will then find that taller persons ran faster, on average. For data we take all the times in the finals of the 100 meters in the Olympics 2016.

regress x on y stata

Imagine that we want to investigate the effect of a persons height on running speed. And at the very least, we can investigate whether a relationship is spurious, that is, caused by other variables. However, we can make it more or less likely. No statistical method can really prove that causality is present. You've probably heard the expression "correlation is not causation." It means that just because we can see that two variables are related, one did not necessarily cause the other. A major strength of regression analysis is that we can control relationships for alternative explanations.








Regress x on y stata