I have two variables that are structured as below, one refers to the geographic location and another is the average unemployment rate for a given demographic group and a given time period in California.
I am interested in using the average unemployment rate per region as an explanatory variable in a regression model with SAT scores as my predictor variable.
```
dataex average_unemp region
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str4 average_unemp str16 region
"11.6" "Southern California"
"11.6" "Southern California"
"11.6" "Southern California"
"11.4" "Sacramento"
"11.6" "Southern California"
"11.6" "Southern California"
"11.6" "Southern California"
"11.4" "Sacramento"
"11.6" "Southern California"
"11.6" "Southern California"
"22.6" "San Dego"
"11.6" "Southern California"
"11.6" "Southern California"
```
I have created a dummy variable for both as in below:
```
encode average_unemp, gen(average_unemp_dummy)
```
However, when I ran my regression model, the average unemployment rate was displayed in the results, but I am actually interested in displaying the region's name with the results to know which region I am looking at.
```
regress SAT_score i.gender_dummy i.average_unemp_dummy
Source | SS df MS Number of obs = 5,480
-------------+---------------------------------- F(13, 5466) = 195.10
Model | 106720.18 13 8209.24464 Prob > F = 0.0000
Residual | 229988.42 5,466 42.0761837 R-squared = 0.3170
-------------+---------------------------------- Adj R-squared = 0.3153
Total | 336708.6 5,479 61.4543895 Root MSE = 6.4866
-------------------------------------------------------------------------------------
SAT_score | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------------+----------------------------------------------------------------
gender_dummy |
male | -6.637803 .1904906 -34.85 0.000 -7.011241 -6.264366
|
average_unemp_dummy |
10.5 | 7.675088 .5530074 13.88 0.000 6.590973 8.759202
11.4 | 6.21276 .5102991 12.17 0.000 5.21237 7.213149
22.6 | -5.595991 .6094689 -9.18 0.000 -6.790792 -4.401189
```
I am interested in using the average unemployment rate per region as an explanatory variable in a regression model with SAT scores as my predictor variable.
```
dataex average_unemp region
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str4 average_unemp str16 region
"11.6" "Southern California"
"11.6" "Southern California"
"11.6" "Southern California"
"11.4" "Sacramento"
"11.6" "Southern California"
"11.6" "Southern California"
"11.6" "Southern California"
"11.4" "Sacramento"
"11.6" "Southern California"
"11.6" "Southern California"
"22.6" "San Dego"
"11.6" "Southern California"
"11.6" "Southern California"
```
I have created a dummy variable for both as in below:
```
encode average_unemp, gen(average_unemp_dummy)
```
However, when I ran my regression model, the average unemployment rate was displayed in the results, but I am actually interested in displaying the region's name with the results to know which region I am looking at.
```
regress SAT_score i.gender_dummy i.average_unemp_dummy
Source | SS df MS Number of obs = 5,480
-------------+---------------------------------- F(13, 5466) = 195.10
Model | 106720.18 13 8209.24464 Prob > F = 0.0000
Residual | 229988.42 5,466 42.0761837 R-squared = 0.3170
-------------+---------------------------------- Adj R-squared = 0.3153
Total | 336708.6 5,479 61.4543895 Root MSE = 6.4866
-------------------------------------------------------------------------------------
SAT_score | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------------+----------------------------------------------------------------
gender_dummy |
male | -6.637803 .1904906 -34.85 0.000 -7.011241 -6.264366
|
average_unemp_dummy |
10.5 | 7.675088 .5530074 13.88 0.000 6.590973 8.759202
11.4 | 6.21276 .5102991 12.17 0.000 5.21237 7.213149
22.6 | -5.595991 .6094689 -9.18 0.000 -6.790792 -4.401189
```
Comment