Professional Documents
Culture Documents
Section 714.1
Instructor: Dr. Nadira Sultana Kakoly
Total: /20
1. What is the mean price of the sample of cars? (1 mark)
sum price
-------------+---------------------------------------------------------
2. What is the price range of the sample (minimum and maximum values)? (1 mark)
sum price
Ans: The price range of the sample (minimum and maximum values) are 3291 and 15906
1
3. What proportions of the cars have poor, fair, average, good and excellent repair history in
the sample? Did any of the sample fail to indicate their repair history, if so how many? (2
marks)
tab rep78
Repair |
Record 1978 | Freq. Percent Cum.
------------+-----------------------------------
Poor | 2 2.90 2.90
Fair | 8 11.59 14.49
Average | 30 43.48 57.97
Good | 18 26.09 84.06
Excellent | 11 15.94 100.00
------------+-----------------------------------
Total | 69 100.00
Ans: The proportions of the cars have poor, fair, average, good and excellent repair history in the
sample are 2.90%, 11.59%, 43.48%, 26.09%, 15.94%
2
4. What percentage of the sample cars were foreign? (2 mark)
tab foreign
. gen high_price_cars=.
(74 missing values generated)
. tab high_price_cars
high_price_ |
cars | Freq. Percent Cum.
------------+-----------------------------------
0| 52 70.27 70.27
1| 22 29.73 100.00
------------+-----------------------------------
Total | 74 100.00
. tab high_price_cars
.
6. Write down the descriptive statistics (number and percentage) for your new variable
high_price_cars. (6 marks)
7. Create a pie chart showing the proportions of the high and low priced cars using the
newly created variable.
29.73%
70.27%
In the first group include cars who have very good repair history (good and excellent).
These will be coded 1.
In the second group include cars who have bad repair history (poor, fair and average).
These will be coded 2. (4 marks)
Ans:
gen repair_good= rep78
(5 missing values generated)
. label define Repair_good 1"good and excellent" 2"poor, fair and average"
. tab repair_good
Here, the table shows that, the p value is less than .05 which reject the null hypothesis. The
result indicates that, there is statistically significant difference in the average weight of cars
(weight) for foreign and domestic cars (foreign).
10. Conduct a test of significance to find out if there is a statistically significant difference in
the percentage of cars with very good repair history (repair_good) between foreign and
domestic cars (foreign). Paste the output of your analysis as evidence of your conclusion.
In a line or 2 please interpret your findings. (3 marks)
tab repair_good foreign, row chi
+----------------+
| Key |
|----------------|
| frequency |
| row percentage |
+----------------+
| Car type
repair_good | Domestic Foreign | Total
----------------------+----------------------+----------
good and excellent | 11 18 | 29
| 37.93 62.07 | 100.00
----------------------+----------------------+----------
poor, fair and averag | 37 3| 40
| 92.50 7.50 | 100.00
----------------------+----------------------+----------
Total | 48 21 | 69
| 69.57 30.43 | 100.00
Pearson chi2(1) = 23.6449 Pr = 0.000
Here the table shows that, the p value is less than .05 which indicates that there is a
statistically significant difference in the percentage of cars with very good repair history
(repair_good) between foreign and domestic cars (foreign).