Week 6 Assignments
RUNNING HEADER: WEEK 3 ASSIGNMENT 4 1
WEEK 3 ASSIGNMENT 4 13
Week 3 Assignment 4
Introduction
In this project I selected six variables from the ' SampleDataSet.xlsx'. Among these six variables three of them were continuous and the reaming three were discrete variables. The continuous variables selected for this study are Age, WealthScore and MedianSchoolYears. The discrete variables selected for this study are NumberOfChildren, MailResponder and NumberOfCars.
Analysis
Age
The age is a continuous variable which takes only positive values even though we usually consider the integer part of it. The descriptive statistics summary of the age variable are shown below.
Table -1: Descriptive statistics of Age
|
Age |
|
|
Mean |
46.202 |
|
Median |
48 |
|
Mode |
0 |
|
Standard Deviation |
20.85197 |
|
Sample Variance |
434.8046 |
|
Kurtosis |
0.249096 |
|
Skewness |
-0.67306 |
|
Range |
96 |
|
Minimum |
0 |
|
Maximum |
96 |
|
Sum |
92404 |
|
Count |
2000 |
Table-1, shows that the data consists of the ages of 2000 people. The mean age is 46.202 years, median age is 48, but the mode is 0. The largest age is 96 with variability measured by standard deviation is 20.85.
Graph-1: Distribution of Age
The age distribution using histogram is shown is Graph-1. Bearing a clustering at 0, the distribution of age is approximately symmetric.
Wealth Score
Table -2: Descriptive statistics of WealthScore
|
WealthScore |
|
|
Mean |
301.8376 |
|
Median |
299.01 |
|
Mode |
490.46 |
|
Standard Deviation |
94.35198 |
|
Sample Variance |
8902.296 |
|
Kurtosis |
-0.66676 |
|
Skewness |
0.124734 |
|
Range |
390.46 |
|
Minimum |
100 |
|
Maximum |
490.46 |
|
Count |
2000 |
Table-2, shows that the data consists of the wealth scores of 2000 samples. The mean score is 301.84, median age is 299.01 and the mode is 490.46. The largest age is 490.46 with variability measured by standard deviation is 94.35.
Graph-2: Histogram of wealth score
The histogram of the wealth scores in Graph -2 shows that the distribution is approximately symmetric and bell shape.
Median School years
Table -3: Descriptive statistics of MedianSchoolYears
|
MedianSchoolYears |
|
|
Mean |
13.26322 |
|
Median |
13.2 |
|
Mode |
12 |
|
Standard Deviation |
1.424966 |
|
Sample Variance |
2.030528 |
|
Kurtosis |
-0.21916 |
|
Skewness |
0.303654 |
|
Range |
12.4 |
|
Minimum |
5.7 |
|
Maximum |
18.1 |
|
Count |
1903 |
From Table-3 we can see that the sample consists of the median school years of 1903 people. The mean of the variable is 13.26 years, median age is 13.2 and the mode is 12 years. The maximum years is 18.1 with variability measured by standard deviation is 1.42 years.
Graph-3: Histogram of school years
The histogram of the median school years in Graph -3 shows that, the distribution is approximately positively skewed.
Number of Children
Table -4: Descriptive statistics of the number of children
|
NumberOfChildren |
|
|
Mean |
0.586 |
|
Median |
0 |
|
Mode |
0 |
|
Standard Deviation |
1.020355 |
|
Sample Variance |
1.041125 |
|
Kurtosis |
3.045176 |
|
Skewness |
1.876443 |
|
Range |
6 |
|
Minimum |
0 |
|
Maximum |
6 |
|
Sum |
1172 |
|
Count |
2000 |
The descriptive statistics of the number of children shows that the average number of children is 0.586 with majority having no children. Further the distribution of the number of children is positively skewed.
Table -4: Frequency table representing the number of children
|
NumberOfChildren |
Frequency |
|
0 |
1355 |
|
1 |
323 |
|
2 |
174 |
|
3 |
99 |
|
4 |
42 |
|
5 |
6 |
|
6 |
1 |
Graph-4: Frequency distribution of the number of children
Graph-5: Pie chart representing the number of children
Mail Responder
The mode of the variable mail responder is 2
Table 5: Frequency of the mail responder
|
Mail responder |
Frequency |
|
0 |
447 |
|
1 |
515 |
|
2 |
1038 |
Graph-6: Pie chart representing the mail responder
It shows that the mode of the variable mail responder is 2.
Number of cars
Table 6: Descriptive statistics for the number of cars
|
NumberOfCars |
|
|
Mean |
1.0313 |
|
Median |
1 |
|
Mode |
1 |
|
Standard Deviation |
1.0557 |
|
Sample Variance |
1.1146 |
|
Kurtosis |
6.0731 |
|
Skewness |
1.72 |
|
Range |
9 |
|
Minimum |
0 |
|
Maximum |
9 |
|
Sum |
956 |
|
Count |
927 |
Hypothesis tests
The first hypothesis tested in this study is regarding the mean age. The null hypothesis H0 was that the mean age of the population is 50. Alternative hypothesis H1 was that the mean age of the population is less than 50. 5% level of significance is used to test the hypothesis. The null hypothesis was rejected (t =-8.145, df= 1999, p value <0.000) at 5% level. Therefore, we conclude that there is enough evidence to support the claim that the mean age is less than 50.
Table 7: Test for the mean age
|
|
Age |
hypo. Value |
|
Mean |
46.202 |
50 |
|
Variance |
434.8046 |
0 |
|
Observations |
2000 |
2000 |
|
Pearson Correlation |
#DIV/0! |
|
|
Hypothesized Mean Difference |
0 |
|
|
df |
1999 |
|
|
t Stat |
-8.1456 |
|
|
P(T<=t) one-tail |
3.29E-16 |
|
|
t Critical one-tail |
1.645616 |
|
|
P(T<=t) two-tail |
6.57E-16 |
|
|
t Critical two-tail |
1.961151 |
|
Now the hypothesis tested in this study is regarding the mean wealth score. The null hypothesis H0 was that the mean wealth score of the population is 300. Alternative hypothesis H1 was that the mean wealth score of the population is not equal to 300. The null hypothesis was not able to rejected (t 0.871003, df= 1999, p value = 0.389) at 5% level. Therefore, we conclude that there is not enough evidence to support the claim that the mean wealth score is different from 300. Details are given in Table -8
Table 8: Test for the mean wealth score
|
|
WealthScore |
Null wealth |
|
Mean |
301.8376 |
300 |
|
Variance |
8902.296 |
0 |
|
Observations |
2000 |
2000 |
|
Pearson Correlation |
#DIV/0! |
|
|
Hypothesized Mean Difference |
0 |
|
|
df |
1999 |
|
|
t Stat |
0.871003 |
|
|
P(T<=t) one-tail |
0.191929 |
|
|
t Critical one-tail |
1.645616 |
|
|
P(T<=t) two-tail |
0.383857 |
|
|
t Critical two-tail |
1.961151 |
|
The third hypothesis tested in this study is regarding the mean value of the median school years. The null hypothesis H0 was that the mean school year of the population is 12 years. Alternative hypothesis H1 was that the mean school year of the population is greater than 12 years. The null hypothesis was rejected (t =38.672, df= 1902, p value <0.000) at 5% level. Therefore, we conclude that there is enough evidence to support the claim that the mean of teh median school years is greater than 12.
Table 9: Test for the mean school years
|
|
MedianSchoolYears |
Null schoolyears |
|
Mean |
13.26322 |
12 |
|
Variance |
2.030528 |
0 |
|
Observations |
1903 |
1903 |
|
Pearson Correlation |
#DIV/0! |
|
|
Hypothesized Mean Difference |
0 |
|
|
df |
1902 |
|
|
t Stat |
38.67163 |
|
|
P(T<=t) one-tail |
3.4E-242 |
|
|
t Critical one-tail |
1.645655 |
|
|
P(T<=t) two-tail |
6.9E-242 |
|
|
t Critical two-tail |
1.961212 |
|
Now a chi-square test is conducted to test the independence of the number of children and the number of Cars. The null hypothesis H0 was the number of children and the number of cars is independent. The alternative hypothesis H1 is that the number of children and the number of cars is dependent
Table 10: Contingency table
|
|
|
zero |
one |
two |
three |
four |
Five |
Six above |
Total |
|
zero |
|
940 |
274 |
94 |
32 |
8 |
3 |
1 |
1352 |
|
one |
|
223 |
51 |
30 |
16 |
1 |
1 |
1 |
323 |
|
two |
|
113 |
35 |
15 |
6 |
2 |
0 |
1 |
172 |
|
three |
|
75 |
14 |
6 |
2 |
1 |
0 |
1 |
99 |
|
four |
|
24 |
13 |
4 |
0 |
0 |
0 |
1 |
42 |
|
Five |
|
5 |
1 |
0 |
0 |
0 |
0 |
0 |
6 |
|
Six |
|
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
|
Total |
|
1381 |
388 |
149 |
56 |
12 |
4 |
5 |
1995 |
Table 11: Hypothesis test
|
35.99 |
chi-square |
|
36 |
df |
|
.4691 |
p-value |
The null hypothesis was not to reject ( = 35.99, df=36, p value <0.4961 ) at 5% level. There is not enough evidence that the number of children is independent of the vehicles.
Limitations of the study
There were a number of missing observations in the variable, number of cars. The t test assumes that the distribution of the population is normal. But we have not conducted the study for normality of the populations.
References
Doane and Seward (2010), Applied Statistics in Business and Economics: the McGraw Hills Ltd.
Linda, Marchal, and Wathen (2008), Statistical Techniques in Business & Economics, 13th
edition. New York, NY: McGraw Hill.
Number of Children
NumberOfChildren 0 1 2 3 4 5 6 Frequency 1355 323 174 99 42 6 1Number of childrens
zero one two three four five six 1355 323 174 99 42 6 1 Frequency zero one two 447 515 1038Histogram of Age
Frequency 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 More 202 0 0 0 1 29 128 111 206 173 265 171 240 158 118 65 89 24 15 2 3 0Age
Frequency
Distribution of WealthScore
Frequency 0 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 More 0 0 0 0 9 26 64 82 118 167 183 172 192 179 174 176 138 98 64 58 100 0WealthScore
Frequency
Histogram of MedianSchoolYears
Frequency 5 6 7 8 9 10 11 12 13 14 15 16 17 18 More 0 1 0 0 0 1 42 405 452 447 298 204 45 7 1MedianSchoolYears
Frequency