Chapter 13, p. 588, Question #38: Different Assembly Methods for a New Product.

Three different assembly methods have been proposed for a new product. A completely randomized experimental design was chosen to determine which assembly method results in the greatest number of parts produced per hour, and 30 workers were randomly selected and assigned to use one of the proposed methods. The number of units produced by each worker follows.

MethodMatrix = matrix(data=c(97,73,93,100,73,91,100,86,92,95,93,100,93,55,77,91,85,73,90,83,99,94,87,66,59,75,84,72,88,86),nrow=10, ncol=3,byrow=FALSE)
colnames(MethodMatrix) = c("A", "B", "C")
f = c("A", "B", "C")
print(MethodMatrix)
##         A   B  C
##  [1,]  97  93 99
##  [2,]  73 100 94
##  [3,]  93  93 87
##  [4,] 100  55 66
##  [5,]  73  77 59
##  [6,]  91  91 75
##  [7,] 100  85 84
##  [8,]  86  73 72
##  [9,]  92  90 88
## [10,]  95  83 86

Use these data and test to see whether the mean number of parts produced is the same with each method. Use alpha = 0.05.

k=ncol(MethodMatrix)
n=nrow(MethodMatrix)
tm=gl(k,n,n*k,factor(f))
r=c(as.matrix(MethodMatrix))
anova=aov(r~tm)
summary(anova)
##             Df Sum Sq Mean Sq F value Pr(>F)
## tm           2    420   210.0   1.478  0.246
## Residuals   27   3836   142.1
print(anova)
## Call:
##    aov(formula = r ~ tm)
## 
## Terms:
##                   tm Residuals
## Sum of Squares   420      3836
## Deg. of Freedom    2        27
## 
## Residual standard error: 11.91948
## Estimated effects may be unbalanced

H_0: Mean number of parts produced is the same with each method.

H_a: Mean number of parts produced is the not the same with each method.

Since the p value is greater than alpha = 0.05, do not reject H_0. There is not enough statistical evience to show that the mean number of parts produced is not the same at a 0.05 level of significance.

——————————————————————————————————————

Chapter 12, p. 538, Question #29: Proportion of married couples where both husband and wife are in the workforce.

Samples in three cities, Anchorage, Atlanta, and Minneapolis, were used to learn about the proportion of married couples where both husband and wife are in the workforce.

WorkMatrix = matrix(data=c(57,33,70,50,63,27), nrow=2, ncol=3, byrow=FALSE)
colnames(WorkMatrix)=c("Anchorage", "Atlanta", "Minneapolis")
rownames(WorkMatrix)=c("Both Work", "Only One")
print(WorkMatrix)
##           Anchorage Atlanta Minneapolis
## Both Work        57      70          63
## Only One         33      50          27

a. Conduct a hypothesis test to determine if the population proportion of married couples with both husband and wife in the workforce is the same for three cities. Using a 0.5 level of significance, what is the p-value and what is your conclusion?

chisq.test(WorkMatrix)
## 
##  Pearson's Chi-squared test
## 
## data:  WorkMatrix
## X-squared = 3.0144, df = 2, p-value = 0.2215

H_0: City and ‘couple workforce’ are similar. (p1 = p2 = p3. p* for population of married couples w/ ‘both’ (husband & wife) working in city ‘X’.)

H_a: City and ‘couple workforce’ are not similar.

Do not reject H_0 since p value is greater than alpha = 0.05. The population proportion of married couples with both the husband & wife are in the workforce is the same for the three cities.

b. Using these three samples, what is an estimate of the proportion of married couples with both husband and wife in the workforce?

BothWork=sum(WorkMatrix[1,])
print(BothWork)
## [1] 190
AllWork=sum(WorkMatrix)
print(AllWork)
## [1] 300
BothWorkPercent = BothWork/AllWork
print(BothWorkPercent)
## [1] 0.6333333
print(paste("Using these three samples, an estimate of the proportion of married couples with both husband and wife in the workforce is", round(BothWorkPercent*100, digits=1),"%"))
## [1] "Using these three samples, an estimate of the proportion of married couples with both husband and wife in the workforce is 63.3 %"

——————————————————————————————————————

Chapter 12, p. 538, Question #30: Faster / slower pace of life by gender.

A Pew Research Center survey asked respondents if they would rather live in a place with a slower pace of life or a place with a faster pace of life. The survey also asked the respondent’s gender. Consider the following sample data:

PaceMatrix = matrix(data=c(230,20,90,218,24,48), nrow=3, ncol=2, byrow=FALSE)
colnames(PaceMatrix)=c("Male", "Female")
rownames(PaceMatrix)=c("Slower", "No Preference", "Faster")
print(PaceMatrix)
##               Male Female
## Slower         230    218
## No Preference   20     24
## Faster          90     48

a. Is the preferred pace of life independent of gender? Using a 0.05 level of significance, what is the p-value and what is your conclusion?

chisq.test(PaceMatrix)
## 
##  Pearson's Chi-squared test
## 
## data:  PaceMatrix
## X-squared = 9.5596, df = 2, p-value = 0.008398

H_0: Preferred pace of life is independent of gender.

H_1: Preferred pace of life is not independent of gender.

Reject H_0 since p is less than alpha = 0.05. Preferred pace of life is not independent of gender at a 0.05 level of significance.

b. Discuss any differences between the preferences of men and women.

——————————————————————————————————————

Chapter 12, p. 539, Question #33: Toyota Corolla – Note: change 17% to 18%

Based on sales over a six-month period, the five top selling compact cars are Chevy Cruz, For Focus, Hyundai Elantra, Honda Civic, and Toyota Corolla. Based on total sales, the market shares for these five compact cars were Chevy Cruz 24%, Ford Focus 21%, Hyundai Elantra 19%, Honda Civic 18%, and Toyota Corolla 17%.

MarketMatrix = matrix(data=c(.24,.21,.19,.18,.17))
rownames(MarketMatrix) = c("Chevy Cruz", "Ford Focus", "Hyundai Elantra", "Honda Civic", "Toyota Corolla")
colnames(MarketMatrix) = c("Market Share")
print(MarketMatrix)
##                 Market Share
## Chevy Cruz              0.24
## Ford Focus              0.21
## Hyundai Elantra         0.19
## Honda Civic             0.18
## Toyota Corolla          0.17

A sample of 400 compact car sales in Chicago showed the following number of vehicles sold.

SampleMatrix = matrix(data=c(108,92,64,84,52))
rownames(SampleMatrix) = c("Chevy Cruz", "Ford Focus", "Hyundai Elantra", "Honda Civic", "Toyota Corolla")
colnames(SampleMatrix) = c("Sample Sales")
print(SampleMatrix)
##                 Sample Sales
## Chevy Cruz               108
## Ford Focus                92
## Hyundai Elantra           64
## Honda Civic               84
## Toyota Corolla            52

Use a goodness fit test to determine if the sample data indicate that the market shares for the five compact cards in Chicago are different than the market shares reported by Motor Trend. Using a 0.05 level of significance, what is the p-value and what is your conclusion?

What market share differences, if any, exist in Chicago?

Percentages reported by Motor Trend magazine.

p0=c(.24,.21,.19,.18,.18)
names(p0) = c("Chevy Cruz", "Ford Focus", "Hyundai Elantra", "Honda Civic", "Toyota Corolla")
print(p0)
##      Chevy Cruz      Ford Focus Hyundai Elantra     Honda Civic 
##            0.24            0.21            0.19            0.18 
##  Toyota Corolla 
##            0.18

Sample car sale data from Chicago.

f=c(108,92,64,84,52)
names(f) = c("Chevy Cruz", "Ford Focus", "Hyundai Elantra", "Honda Civic", "Toyota Corolla")
print(f)
##      Chevy Cruz      Ford Focus Hyundai Elantra     Honda Civic 
##             108              92              64              84 
##  Toyota Corolla 
##              52

Use alpha = 0.05 to determine whether these data support the percentages reported by Motor Trend magazine.

H_0: The percentage are the same as the percentages reported by Motor Trend.

H_a: The percentage are not the same as the percentages reported by Motor Trend magazine.

chisq.test(f,p=p0)
## 
##  Chi-squared test for given probabilities
## 
## data:  f
## X-squared = 11.712, df = 4, p-value = 0.01962

Since p value is less tha alpha, reject H_0. The data from Chicago do not support the percentages reported by Motor Trend magazine at a 0.05 level of significance.