Question

Problem 1)

    Moist       Shrew
1    355            0.5
2    370            2.0
3    380            2.0
4    380            0.5
5    380            3.0
6    400            0.0
7    400            4.0
8    415             0.5
9    415             2.0
10   415            4.0
11   415             4.0
12   430            1.0
13   440            2.0
14   440            5.0
15   470            7.0

a) Find Pearson’s correlation r for the data. Consider this as an estimate for the population correlation p.
b) Using 1000 bootstrap samples find and display a histogram for the bootstrap sampling distribution of r.
c) Find the bootstrap MSE and a 90% confidence interval for p based on your sampling distribution of r.

Your R code should display r, the histogram, the bootstrap MSE, and the confidence limits.

Problem 2)

    Sex    TipPct
1 Female 23.44
2 Female 16.51
3 Female 28.33
4 Female 72.46
5 Female 33.49
6 Female 33.61
7 Female 20.63
8 Female 64.52
9 Female 44.44
10 Female 21.74
11 Female 47.41
12 Female 24.34
13 Female 40.40
14 Female 25.10
15 Female 29.66
16 Female 40.54
17 Female 24.19
18 Female 21.01
19 Female 26.74
20 Female 27.27
21 Female 32.52
22 Female 28.56
23 Female 27.71
24 Female 33.07
25 Female 44.78
26 Female 18.12
27 Female 22.66
28 Female 31.25
29 Female 30.08
30 Female 27.10
31 Female 39.06
32 Female 24.82
33 Female 21.10
34 Female 31.25
35 Female 33.99
36 Female 33.61
37 Female 27.55
38 Female 22.44
39 Female 8.00
40 Female 26.78
41 Female 36.36
42 Female 20.15
43 Female 28.48
44 Female 30.08
45 Female 20.59
46   Male 12.54
47   Male 31.13
48   Male 9.09
49   Male    9.09
50   Male 14.62
51   Male 12.05
52   Male 25.56
53   Male 21.21
54   Male 18.18
55   Male 27.27
56   Male 23.26
57   Male 16.81
58   Male 14.49
59   Male 20.85
60   Male 15.15
61   Male 23.26
62   Male 16.73
63   Male 15.81
64   Male 17.77
65   Male 16.95
66   Male 13.64
67   Male 18.69
68   Male 14.70
69   Male 23.08
70   Male 20.55
71   Male 20.34
72   Male 16.28
73   Male 21.98
74   Male 22.56
75   Male 21.21
76   Male 20.79
77   Male 27.27
78   Male 23.26
79   Male 9.09
80   Male 38.10
81   Male 33.44
82   Male    0.00
83   Male 15.09
84   Male 0.00
85   Male 48.00
86   Male 30.77
87   Male 0.00
88   Male 39.53
89   Male 18.18

a) Notice that the tip percentages are given in specific values. Use R to convert the tip percentages “low” if it is equal to or less than 30, and convert it to “high” otherwise. You may disregard the original numeric tip percentages values now.
b) Assuming there is no association between these two variables (in the population), find the expected counts for each of the four groups: (male/low), (male/high), (female/low), (female/high). Hint: you may use table() function to summarize the observed counts in a 2x2 table.
c) Find the chi-square test statistic of association between sex and the low/high tip percentage. Also, find the p-value. You may not use the R function chisq.test() for this. You do not have to interpret these results.

Your R code should display the expected counts, test statistic, and p-value.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

# Problem 1
#data <- read.table("data.csv", header=TRUE, sep=",")
#attach(data)
#View(data)
# a)

load("data.q1.RData")
attach(data)
r <- cor(Moist, Shrew)
print(paste("r =", r))
# r = 0.5877494
boot.data <- matrix(NA, nrow=1000)...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Advanced Biostatistics Questions
Homework Solution
$35.00
Biostatistics
Mathematics
Poisson Regression
Linear Model
Data
Explanatory Habitat
Plots
Cover Measurements
Statistical Issues
Response Variables
Graphing Functions
R Programming
Biostatistics Problems
Homework Solution
$48.00
Statistics
Mathematics
Variables
Measurement
Random
Data
Poisson Distribution
Principle Components
Analysis
Graphs
Data Analysis Using R-Programming
Homework Solution
$65.00
Statistics
R Programming
Mathematics
Computer Science
Data Analysis
Results
Layman's Terms
Figures
Codes
Assumptions
Statistics Questions Using R-Programming
Homework Solution
$60.00
Mathematics
Statistics
Computer Science
R Programming
Cyclic Coordinate Descent
Rayleigh Quotient
Minimization
Derivatives
Zeroes
Quadratic Equation Method
Peg Game
Triangles
Holes
Matrices
Rows
Columns
Moves
Data Analysis and Manipulation
Homework Solution
$35.00
Statistics
Data Analysis
Data Sets
Linear Regression
ANOVA
Normality Test
Null Hypothesis
Alternative Hypothesis
Research
Functions
Tables
R Programming Problems
Homework Solution
$33.00
Mathematics
Statistics
R Programming
Baseball Players
Strikes
Scores
Samples
Information
Estimation
Functions
Countries
Standard Errors
Salary
Get help from a qualified tutor
Live Chats