Docsity

Regression Analysis: Relationship between Income, Education, and Age, Study notes of Statistics

Toggle sidebar
bg1
. input x
x
1. 12
2. 13
3. 12
4. 14
5. 12
6. 15
7. 12
8. end
. input y
y
1. 20000
2. 22000
3. 23000
4. 25000
5. 18000
6. 30000
7. 26000
8. end
. reg y x
Source | SS df MS Number of obs = 7
-------------+------------------------------ F( 1, 5) = 5.91
Model | 51843318 1 51843318 Prob > F = 0.0593
Residual | 43870967.7 5 8774193.55 R-squared = 0.5416
-------------+------------------------------ Adj R-squared = 0.4500
Total | 95714285.7 6 15952381 Root MSE = 2962.1
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | 2419.355 995.3064 2.43 0.059 -139.1616 4977.871
_cons | -7677.419 12845.68 -0.60 0.576 -40698.29 25343.45
------------------------------------------------------------------------------
. rename y income
. rename x ed
. input age
age
1. 45
2. 35
3. 27
4. 60
5. 23
6. 30
7. 49
8. end
docsity.com
pf3
pf4

Partial preview of the text

Download Regression Analysis: Relationship between Income, Education, and Age and more Study notes Statistics in PDF only on Docsity!

. input x

x

  1. 12
  2. 13
  3. 12
  4. 14
  5. 12
  6. 15
  7. 12
  8. end . input y

y

  1. 20000
  2. 22000
  3. 23000
  4. 25000
  5. 18000
  6. 30000
  7. 26000
  8. end . reg y x

Source | SS df MS Number of obs = 7 -------------+------------------------------ F( 1, 5) = 5. Model | 51843318 1 51843318 Prob > F = 0. Residual | 43870967.7 5 8774193.55 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | 95714285.7 6 15952381 Root MSE = 2962.

y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | 2419.355 995.3064 2.43 0.059 -139.1616 4977. _cons | -7677.419 12845.68 -0.60 0.576 -40698.29 25343.


. rename y income . rename x ed . input age

age

  1. 45
  2. 35
  3. 27
  4. 60
  5. 23
  6. 30
  7. 49
  8. end

. tab1 x ed

-> tabulation of x

x | Freq. Percent Cum. ------------+----------------------------------- 12 | 4 57.14 57. 13 | 1 14.29 71. 14 | 1 14.29 85. 15 | 1 14.29 100. ------------+----------------------------------- Total | 7 100.

. reg income ed age

Source | SS df MS Number of obs = 7 -------------+------------------------------ F( 2, 4) = 2. Model | 53510712.8 2 26755356.4 Prob > F = 0. Residual | 42203572.9 4 10550893.2 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | 95714285.7 6 15952381 Root MSE = 3248.

income | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ed | 2354.383 1103.604 2.13 0.100 -709.7125 5418. age | 39.88367 100.3276 0.40 0.711 -238.6705 318. _cons | -8374.74 14195.13 -0.59 0.587 -47786.75 31037.


[A third example using total depression score was already in the notes and was done for a previous homework assignment and is not reproduced here]

. histogram residuals (bin=10, start=-26.039661, width=4.4203238)

0

.

.

.

.

.

Density

-30 -20 -10 0 10 20 Residuals

The above histogram shows “density” as the y-axis. If you would like frequency as your y-axis instead, type this command: “histogram residuals, frequency”. As always, using the drop-down menus would help you figure this out.