Colab- R 1

Question 1

Some archaeologists theorize that ancient Egyptians interbred with several different immigrant populations over thousands of years. To see if there is any indication of changes in body structure that might have resulted, they measured skulls of male Egyptians from 5 different epochs.

Thomson and Randall-Maciver, Ancient Races of the Thebaid, Oxford: Oxford University Press, 1905.

The data can be found in SkullsComplete.csv. The column mb measures the maximum breadth of the skull in millimetres.

For the remaining questions, we will not be using the columns bh, bl or nh. Remove them from the dataframe and display the first 10 rows.


Question 2

Create a barplot of the mean maximal breadth measured for each epoch in the SkullsComplete.csv data. Give the plot errorbars with classic 95% confidence intervals.

Order the epochs so that, left to right, they go from earliest ( ) to latest ( ). Note that years classified as B.C. count backwards. E.g., is more recent than .

Adjust the y-axis scale so that it goes from 120 at the bottom to 140 at the top.

Make the bars interesting colours (dont use ggplots default colours).

Display a data frame that shows the group means, as well as the lower and upper boundaries of the confidence intervals. Do not display any other statistics inside the data frame.


Question 3

Using the SkullsComplete.csv, create a ordinary least-squares linear model predicting maximal breadth (mb) with coefficients that make the following comparisons:

Report the models formula using the obtained coefficents.

e.g.

4000BC
150AD 3300BC
4000BC

b0 = 4000BC
b1 = 3300BC 4000BC
b2 = 1850BC 4000BC
b3 = 200BC 4000BC
b4 = 150AD 4000BC

= (value) + (value)x1 + (value)x2


Question 4

Is the omnibus F-test from the previous questions linear model statistically significant at an = 0.05? Report its value, degrees of freedom and p-value.

Ensure that the F-statistic and p-value are displayed to 6 decimal places.

To get accurate results, you will need to extract the F-stat values from the summary output.


Question 5

What do the results you displayed in the previous question tell you?


Question 6

Based on the planned contrasts/comparisons you used to evaluate the SkullsComplete.csv data, what epochs was there a significant difference between?

Ensure your table of coefficients are displayed.


Question 7

For the SkullsComplete.csv data, assume all the classic assumptions of a OLS model are satisfied. Calculate an omnibus F-test manually without using lm() or aov() . Report the following . . . .

Grand Mean
Total Sum of Squares
Model Sum of Squares
Residual Sum of Squares
Model Mean Squares
Residual Mean Squares
Multiple R
F statistic
Degrees of Freedom
p-value

Round displayed outputs to 6 decimal places for everything except the degrees of freedom.

These results should be identical to the earlier F-statistic and p-value you obtained. If you get a different result, you have done something wrong somewhere somehow.


Question 8

Does the model you created for the SkullsComplete.csv data violate the normality assumption?


Question 9

The data salary.csv shows the salary of different high-level job positions.

Use polynomial contrasts to determine which type of trends are most appropriate to describe this data. i.e., specify which trend types are significant.


Question 10

Write out the simplest polynomial equation/model (with the obtained values) that BEST describes the trend seen in the salary.csv data.


Question 11

Plot the equation from the previous question as a smooth line on top of the observed values.

WRITE MY PAPER

Comments

Leave a Reply