1 project one carpoll. 2 3 excel convert categorical data into dummy variables type of vehicle:...

56
1 Project One Carpoll

Post on 21-Dec-2015

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

1

Project OneCarpoll

Page 2: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

2

Carpoll

Page 3: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

3

Excel Convert categorical data into dummy

variables Type of vehicle: family, sporty, work Sort type

Select some of family observations Expand selection in dialog box

Code family as one, sporty and work as zero

Page 4: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

4

Page 5: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

5

Page 6: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

6

Page 7: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

7

Vehicle Type Family

Yes: One, 155 No: zero, 148 Total: 303

Page 8: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

8

Page 9: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

9

Plot of Family Type (Zero/One) Vs. Age

y = 0.0196x - 0.0891

R2 = 0.0546

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 10 20 30 40 50 60 70

Age

Pro

bab

ilit

y

Approximation to Cumulative Distribution Function Sigmoid

Page 10: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

10

Page 11: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

11

Sort Gender and Code zero/one Male: one; Female: zero

Select some observations in sex, expand selection, sort

Ditto for marital status Married: one Single: zero

Page 12: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

12

Page 13: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

13

Page 14: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

14

Page 15: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

15

Cross-Classification of Type with GenderFamily Sporty &

WorkTotal

Female 76 62 138

Male 79 86 165

Total 155 148 303

Page 16: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

16

#-Way classification in one step

Page 17: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

17

Family: YesMarried Single Total

Female 58 18 76

Male 61 18 79

Total 119 36 155

Page 18: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

18

Page 19: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

19

Cut and Paste Fambern, age, gender, marital into EViews

File Menu New

workfile

Page 20: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

20

Workfile Dialog Box

Page 21: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

21

Generate x = 1

Page 22: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

22

Page 23: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

23

Page 24: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

24

Page 25: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

25

Estimate Linear Probability Model

Page 26: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

26

Page 27: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

27

Age and marital are significant,And have a positive effect on The probability of choosing aFamily car. Gender barely addsto the explanation and is negative

Given age and gender, being married increases the

Probability of favoring a family car by 0.23

Page 28: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

28

Page 29: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

29

Married and Female

Single and Male

Page 30: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

30

Page 31: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

31

Married and Female

Single and Male

Page 32: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

32

Page 33: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

33

Page 34: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

34

Page 35: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

35

This probability model does a better job of explaining thoseWho favor a family car comparedTo those who don’t

Page 36: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

36

Logit Fit

Page 37: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

37

Married women

Single men

Page 38: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

38

Linear Probability Model Car Size Car size: Small, medium, large Varies with age, gender, and marital status

Page 39: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

39

Page 40: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

40

Page 41: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

41

Sort by Size and then by Age

Page 42: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

42

Contingency Table Analysis: ObservedSmall Medium Large Margin

18-29 70 59 15 149

30-39 59 58 21 138

40- 8 7 6 21

Margin 137 124 42 303

Page 43: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

43

Contingency Table Analysis: Small Medium Large Margin

18-29 149

30-39 138

40- 21

Margin 137 124 42 303

Page 44: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

44

Contingency Table Analysis: ExpectedSmall Medium Large Margin

18-29 67.4 61.0 20.7 149

30-39 62.4 56.5 19.1 138

40- 9.5 8.6 2.9 21

Margin 137 124 42 303

Page 45: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

45

Contingency Table Analysis: [Observed – Expected]2

Small Medium Large

18-29 6.76 4.0 32.49

30-39 11.56 2.25 3.61

40- 2.25 2.56 9.61

Page 46: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

46

Page 47: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

47

0.00

0.05

0.10

0.15

0 5 10 15

CHIR

DE

NS

9.5

5%

2 =75.09

Page 48: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

48

Contingency Table Analysis: Small Medium Large

18-29 Fewer than exp

30-39 Fewer than exp

40- More than exp

Margin

Page 49: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

49

Summary

People in their 20’s prefer smaller cars People in their forties or older prefer large

cars

Page 50: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

50

Country Vs. Size Country: American, European, Japanese Size: small, medium, large

Page 51: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

51

Contingency Table Analysis: Observed Small Medium Large Margin

American 26 19 92 137

European 53 17 54 124

Japanese 36 4 2 42

Margin 115 40 148 303

Page 52: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

52

Contingency Table Analysis: Small Medium Large Margin

American 137

European 124

Japanese 42

Margin 115 40 148 303

Page 53: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

53

Contingency Table Analysis: Expected Small Medium Large Margin

American 52.0 18.1 66.9 137

European 47.1 16.4 60.6 124

Japanese 15.9 5.5 20.5 42

Margin 115 40 148 303

Page 54: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

54

Contingency Table Analysis: [Observed – Expected]2

Small Medium Large

American 676 0.81 630

European 34.8 0.36 43.6

Japanese 404 2.25 342

Page 55: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

55

Contingency Table Analysis: Small Medium Large

American fewer than exp

more

European

Japanese more fewer

Margin

Page 56: 1 Project One Carpoll. 2 3 Excel Convert categorical data into dummy variables Type of vehicle: family, sporty, work Sort type Select some of family

56

Summary Preference for large American cars and for

small Japanese cars.