Computing group means and the variance


Please follow these instructions carefully, read them first! Your answers should be well structured and concise, and written in complete English sentences. Include your graphs and your code (in typewriter font), comment it. Do not forget to number your answers to refer to the corresponding tasks below.

Tasks

Question1)

Create a data frame in R that will look like this:

fact variable1
A .
A .
. .
B .
B .
. .
C .
. .
D .
. .
The final dimension of the data set should be 48 rows by 2 columns. Each factor level (A, B, C, D) is replicated 12 times. For variable 1, use the following code:
                          variable1=rnorm(48,10)*(rep(rpois(4,.2),each=12)/8+1)
Give this data frame a name of your choice and show the code you used to create it. Explain as much of the code to populate variable 1 with numbers. Comment on the details of the code.

Question 2)

Think of a situation (an experiment or observational study) within your (future) area of research that could produce such a data set. Explain (hypothetically) what was done and how the data were obtained. Throughout the rest of this assignment, pretend these are real data. However, in your interpretation, you may comment at any stage on how the data were created.

Question 3)

Explore your data set using at least 2 commands to summarise your data and at least 2 commands to visually depict your data (plots, histograms,...). At each step / for each plot you create, comment on what you see and what you learn from it.

Question 4)

Compare the maximum and minimum values within each group (factor level) to their respective group means. What is the largest absolute difference between one of your values and its group mean? What are the chances of obtaining such a value, assuming the data are normally distributed and centered around the respective group mean with a standard deviation of 1?

Question 5)
 Formulate a hypothesis based on task 1 that you can test using ANOVA. Perform the analysis. Briefly explain what the F-value tells you and interpret the p-value. Draw a conclusion.

Question 6)

Regardless of whether you found significant differences between groups or not, perform a Tukey’s HSD test to determine what groups are significantly different from each other (even if none are). Briefly interpret this result in view of the nature of your data.

Question 7)

Explain why the output contains an ‘adjusted p-value’. What does it adjust for? Can you outline a simulation experiment in R (you don’t need but you can show how you would program it) that illustrates the problem of multiple comparisons?

Question 8)

Compute the group means and then the variance of the group means for variable1 and assign this number to an object called ‘betweenVar’, meaning ‘between group variance’. Also compute the within-group variance of variable1 and assign this number to an object called ‘withinVar’ for ‘within group variance’.

Question 9)

Using the within- and between groups variances from the task above, conduct a power test for your ANOVA. Regardless of whether your ANOVA result was significant or not, discuss all aspects of the power test (sample size, type I and type II error, power, within- and between group variance) in accordance with the outcome of your ANOVA (as in task 4) and the nature of your data as you described it in task 1. For example, if your ANOVA did not find a significant difference between groups, discuss how you could change your experimental set-up to find an expected difference. Or, if your ANOVA was significant, discuss the power of your test and (for example) your type I error probability and whether / how you could reduce it. Talk about what the design of a larger experiment could look like based on the results of your pilot study, e.g. by bringing in financial aspects.

Question 10)

Show the differences between groups in a bar plot with standard errors. Mark those groups that do not differ significantly with the same letters. Adjust the margins, the label and tick size and position etc. until you think this graph could be published in a journal. Draft a figure caption that contains all the needed information: What is shown? Where? How was it measured? When? What test are the letters referring to?

Request for Solution File

Ask an Expert for Answer!!
Basic Statistics: Computing group means and the variance
Reference No:- TGS0427

Expected delivery within 24 Hours