Question

In: Statistics and Probability

Write a code in R markdown Independent random samples of companies in the three countries yielded...

Write a code in R markdown

Independent random samples of companies in the three countries yielded the following data on financial losses (in trillion dollars).

A B C
13 17 11
10 12 7
13 18 9
14 13 13
15 15 24

(1) Simulate and plot the null distribution of the ANOVA test statistic, including a vertical line corresponding to the observed test statistic value.

(2) Calculate the P-value

(3) Is there a significant difference in the mean profit losses among the three countries? Compare your conclusion with the ordinary one-way ANOVA in the problem above.

(4) Are the residuals normal? Why or why not? Is the ANOVA procedure justified?

Solutions

Expert Solution

R Code:

## Exercise 1

##1

```{r}
la=c(13,10,13,14,15)
lb=c(17,12,18,13,15)
lc=c(11,7,9,13,24)
company=c(rep(1,5),rep(2,5),rep(3,5))
company=as.factor(company)
loss=c(la,lb,lc)
w=aov(lm(loss~company))
anova(w)
```

Thus we get the observed F value as .4096. Now the null distribution is F with 2 and 12 degrees of freedom.
```{r}
curve(df(x,2,12),0,10,col="red",ylab="Density")
abline(v =.4096, untf = FALSE,col="green")
```

#2.

The p value is calculated as .6729.

#3.

Since the p value is more than the 5\%%\ level, no significant difference among the mean profit losses exists.

#4.

```{r}
h=resid(lm(loss~company))
boxplot(h)
boxplot(la,lb,lc,names=c("A","B","C"))
```


In order to check normality, we provide histogram and boxplot of the residuals. We find that the distribution of the residual is more or less negatively skewed. Since it is not symmetric, normality assumption seems not justified. We also provide side by side boxplots to compare the variabilities. We also find differences in variability and that all the distributiuons are not symmetric (specially for Company A, the variability is least). Thus usual ANOVA procedure is not justified.


Related Solutions

Write a code in R markdown Independent random samples of companies in the three countries yielded...
Write a code in R markdown Independent random samples of companies in the three countries yielded the following data on financial losses (in trillion dollars). A B C 13 17 11 10 12 7 13 18 9 14 13 13 15 15 24 (1) Simulate and plot the null distribution of the ANOVA test statistic, including a vertical line corresponding to the observed test statistic value. (2) Calculate the P-value (3) Is there a significant difference in the mean profit...
Independent random samples of released prisoners in the fraud and firearms offense categories yielded the given...
Independent random samples of released prisoners in the fraud and firearms offense categories yielded the given information on time served, in months. At the 1% significance level, do the data provide sufficient evidence to conclude that the mean time served for fraud is less than that for firearms offenses? Assume that populations standard deviations are same for both group. (i.e., we assume σ1 = σ2 .) What is the parameter of interest? What is the underlying distribution? Fraud: 15.2, 11.2,...
Write the R code to generate five independent uniform random numbers and use that to generate...
Write the R code to generate five independent uniform random numbers and use that to generate 5 independent Bernoulli random variables with probability of success p = 0.4. please use RStudio. please do not use lab nor rbern for calculations.
Independent simple random samples from two strains of mice used in an experiment yielded the following...
Independent simple random samples from two strains of mice used in an experiment yielded the following measurements on plasma glucose levels following a traumatic experience: Strain A: 54; 99; 105; 46; 70; 87; 55; 58; 139; 91 Strain B: 93; 91; 93; 150; 80; 104; 128; 83; 88; 95; 94; 97 Do these data provide sufficient evidence to indicate that the variance is larger in the population of strain A mice than in the population of strain B mice? Let...
What is the code in Rstudio or R? (a) Generate 200 random samples of size n...
What is the code in Rstudio or R? (a) Generate 200 random samples of size n = 10 from a Poisson distribution with mean λ = 12. i. Calculate sample means for each sample. Report the first 10 sample means. ii. Draw a histogram of the sample means (where the y-axis is the density) and fit a density estimate (default density estimator is ok). iii. What is your finding about the sampling distribution of the sample mean, based on your...
The following three independent random samples are obtained from three normally distributed populations with equal variance....
The following three independent random samples are obtained from three normally distributed populations with equal variance. The dependent variable is starting hourly wage, and the groups are the types of position (internship, co-op, work study). Group 1: Internship Group 2: Co-op Group 3: Work Study 12.5 13 13.5 10.75 12 13.25 12.5 9.5 11.75 12 12.5 13.25 12.5 12.5 12.75 9.5 14 13.5 12.25 14.25 15 Use technology to conduct a one-factor ANOVA to determine if the group means are...
The following three independent random samples are obtained from three normally distributed populations with equal variances....
The following three independent random samples are obtained from three normally distributed populations with equal variances. The dependent variable is starting hourly wage, and the groups are the types of position (internship, co-op, work study). Round answers to 4 decimal places. Internship Co-op Work Study 9.25 10.5 10.75 9.5 9.75 10 10.75 11 10.5 12 10.75 11.25 10.25 10.25 9.75 10.75 9.25 10.25 10 11.5 9 9.75 9.75 10 10.25 9.5 11.25 12.75 11 10.75 10 11.5 8.75 8.25 10...
The following three independent random samples are obtained from three normally distributed populations with equal variance....
The following three independent random samples are obtained from three normally distributed populations with equal variance. The dependent variable is starting hourly wage, and the groups are the types of position (internship, co-op, work study). We are testing the claim that the starting salaries for new college graduate are different depending on the positions at α=0.2α=0.2 given the following data Group 1: Internship Group 2: Co-op Group 3: Work Study 10 11.25 16 14.75 13 14 10.5 13.5 14 9.5...
The following three independent random samples are obtained from three normally distributed populations with equal variances....
The following three independent random samples are obtained from three normally distributed populations with equal variances. The dependent variable is starting hourly wage, and the groups are the types of position (internship, co-op, work study). Round answers to 4 decimal places. Internship Co-op Work Study 11.25 11 10.5 12.5 11.75 14.75 10.75 14 10.5 11.5 9.5 9.5 12.5 13.5 11 11.75 10.75 13.25 11.75 14.25 10.5 14.25 10.75 12.5 12.5 12.75 12.25 11.5 11.25 9.5 12 12.25 11.75 10.5 12...
The following three independent random samples are obtained from three normally distributed populations with equal variance....
The following three independent random samples are obtained from three normally distributed populations with equal variance. The dependent variable is starting hourly wage, and the groups are the types of position (internship, co-op, work study). Group 1: Internship Group 2: Co-op Group 3: Work Study 9 9 13.75 9.25 12.75 11.75 12 11.5 11.25 11.75 14.75 16.25 12.25 8.75 10 11.75 10.5 11.5 10 9.75 12.75 11.25 10.75 15.5 Do not forget to convert this table from parallel format (i.e.,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT