Professional Documents
Culture Documents
Regression 8
Regression 8
separately.
midterm).
How to fit a nonlinear regression line
3.5
2.5
2
數列1
1.5
0.5
0
0 5 10 15 20
From above picture, we can use the following model to fit these
data, which is
i .i .d .
Yi 0 1 X i 2 X i , i ~ N (0, 2 )
i
2
2
(or Y X , ~ N (0, I n ) )
1 X1 X 12
1 X 2 X 22
where X .
... ... ...
1 X X n2
n
In the real world problem, the data could contain some qualitative
can not analyze them unless they first translate into numerical
variables.
Ex.1 : The incomes for 4 female’s and 6 male’s are listed and we
different gender.
income 1000 1150 1200 990 1400 1250 1320 1060 1180 1360
gender F F M M M F M F M M
example, we can set 1 for male and set 0 for female. That is,
1, if male
Di =
0, if female
(or Y X )
1 D1 1
1 D2
where X ... ... ,
0 , and ...
1
1 D 10
10
^
1
Use the formula ( X ' X ) X 'Y , we have
1
^ 10 6 11910 1115
and
6 6 7450 126.7
Yi 1115 126.7 * Di
From above model, we have the following results.
the average income for female is $1115 and this value is the
1000 1150 1250 1060
same as .
4
the average income for male is $1241.7 and this value is the
1200 990 ... 1360
same as .
6
^
Q ? What are the values of 2 and t -value for this sample?
way.