For questions 1-3 use the crabs dataset in the MASS package. The crabs data frame has 200 rows and 8 columns, describing 5 morphological measurements on 50 crabs each of two colourforms and both sexes, of the species Leptograpsusvariegatus collected at Fremantle,
W. Australia. The variables are:
sp: species B or O for blue or orange.
sex: M or F
index: 1:50 within each of the four groups.
FL: frontal lobe size (mm).
RW: rear width (mm).
CL: carapace length (mm).
CW: carapace width (mm).
BD: body depth (mm).
Estimating the Differences between Two Independent Samples
You want to know if there is a difference between the body depth of male and female crabs. First, plot side by side violin plots. Then, write, and run, an R script, using the BEST package that a) produces the posterior distribution for difference in means and the posterior distribution for the difference in standard deviations for male and female crabs. b) prints out a summary of the results, setting the HDI at 89%, the ROPE at 0.1, and calculating the percentage of the difference in means greater that 0.2. c) plots the posterior of the difference in means, and difference in standard deviations indicating the 89% HDI range.
Difference in Means, with Interaction
Now you want to estimate the difference in means, but in a model with an interaction be- tween sex and sp. Use the MCMCregress command. Print the summary and plot the traces and densities.
Estimating the Correlation between BD and RW
Write, and run, an R script that produces an MCMC sample from the posterior distribution of the correlation () between BD and RW. Plot the trace and density of and the two s.
Bayes Factors
Reviews
There are no reviews yet.