Sample solutions manual to Probability and Statistics with R 2nd edition Ugarte Militino Arnholt 2016 PDF

Title Sample solutions manual to Probability and Statistics with R 2nd edition Ugarte Militino Arnholt 2016
Author farsh sardar
Course Probability and its Applications
Institution University of Auckland
Pages 12
File Size 348.9 KB
File Type PDF
Total Downloads 16
Total Views 143

Summary

Authors: Maria Dolores Ugarte – Ana F. Militino – Alan T. Arnholt
Published: Chapman & Hall/CRC 2016
Edition: 2nd
Pages: 682
Type: pdf
Size: 18.8MB
Download After Payment...


Description

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

SOLUTIONS MANUAL FOR Probability and Statistics with R, Second Edition by

María Dolores Ugarte, Ana F. Militino, and Alan T. Arnholt

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

SOLUTIONS MANUAL FOR Probability and Statistics with R, Second Edition by

María Dolores Ugarte, Ana F. Militino, and Alan T. Arnholt

Boca Raton London New York

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2016 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper Version Date: 20150619 International Standard Book Number-13: 978-1-4665-0443-1 (Ancillary) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe.

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

Contents

1 What Is R?

1

2 Exploring Data

27

3 General Probability and Random Variables

79

4 Univariate Probability Distributions

121

5 Multivariate Probability Distributions

171

6 Sampling and Sampling Distributions

209

7 Point Estimation

245

8 Confidence Intervals

307

9 Hypothesis Testing

345

10 Nonparametric Methods

429

11 Experimental Design

477

12 Regression

541

Bibliography

661

Index

671

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

Chapter 1 What Is R?

1. Calculate the following numerical results to three decimal places with R: √ (a) (7 − 8) + 53 − 5 ÷ 6 + 62 √ (b) ln 3 + 2 sin(π) − e3 √ (c) 2 × (5 + 3) − 6 + 92 (d) ln(5) − exp(2) + 23 √ (e) (9 ÷ 2) × 4 − 10 + ln(6) − exp(1) Solution: (a) 131.041 > round((7 - 8) + 5^3 - 5/6 + sqrt(62), 3) [1] 131.041 (b) -18.987 > round(log(3) - sqrt(2) * sin(pi) - exp(3), 3) [1] -18.987 (c) 94.551 > round(2 * (5 + 3) - sqrt(6) + 9^2, 3) [1] 94.551 (d) 2.22 > round(log(5) - exp(2) + 2^3, 3) [1] 2.22 (e) 13.911 > round(9/2 * 4 - sqrt(10) + log(6) - exp(1), 3) [1] 13.911

2. Create a vector named countby5 that is a sequence of 5 to 100 in steps of 5. Solution:

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

2

Probability and Statistics with R, Second Edition: Exercises and Solutions

> countby5 countby5 [1] 5 10 15 [18] 90 95 100

20

25

30

35

40

45

50

55

60

65

70

75

80

85

3. Create a vector named Treatment with the entries “Treatment One” appearing 20 times, “Treatment Two” appearing 18 times, and “Treatment Three” appearing 22 times. Solution: > Treatment xtabs(~Treatment) Treatment Treatment One Treatment Three 20 22

Treatment Two 18

4. Provide the missing values in rep(seq( 15, 10, 10, 10, 5, 5, 5, 5.

,

,

),

) to create the sequence 20, 15,

Solution: > rep(seq(from = 20, to = 5, by = -5), times = 1:4) [1] 20 15 15 10 10 10

5

5

5

5

5. Vectors, sequences, and logical operators (a) Assign the names x and y to the values 5 and 7, respectively. Find xy and assign the result to z. What is the valued stored in z? (b) Create the vectors u = (1, 2, 5, 4) and v = (2, 2, 1, 1) using the c() function. (c) Provide R code to find which component of u is equal to 5. (d) Provide R code to give the components of v greater than or equal to 2. (e) Find the product u × v. How does R perform the operation? (f) Explain what R does when two vectors of unequal length are multiplied together. Specifically, what is u × c(u, v)? (g) Provide R code to define a sequence from 1 to 10 called G and subsequently to select the first three components of G. (h) Use R to define a sequence from 1 to 30 named J with an increment of 2 and subsequently to choose the first, third, and eighth values of J. (i) Calculate the scalar product (dot product) of q = (3, 0, 1, 6) by r = (1, 0, 2, 4).

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

Chapter 1:

What Is R?

3

(j) Define the matrix X whose rows are the u and v vectors from part (b). (k) Define the matrix Y whose columns are the u and v vectors from part (b). (l) Find the matrix product of X by Y and name it W. (m) Provide R code that computes the inverse matrix of W and the transpose of that inverse. Solution: (a) The valued stored in z is 78125. > > > >

x = 2) [1] 1 2 (e) Multiplication of vectors with R is element by element. > uv uv [1] 2 4 5 4 (f) The values in the shorter vector are recycled until the two vectors are the same size. In this case, u*c(u, v) is the same as c(u, u)*c(u, v). > u * (c(u, v)) [1]

1

4 25 16

2

4

5

4

4

5

4

> c(u, u) * c(u, v) [1] (g)

1

4 25 16

2

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

4

Probability and Statistics with R, Second Edition: Exercises and Solutions

> G G[1:3] [1] 1 2 3 (h) > J J[c(1, 3, 8)] [1]

1

5 15

(i) > q r q %*% r [1,]

[,1] 29

(j) > X X u v

[,1] [,2] [,3] [,4] 1 2 5 4 2 2 1 1

(k) > Y Y [1,] [2,] [3,] [4,]

u 1 2 5 4

v 2 2 1 1

(l) > W W u v u 46 15 v 15 10 (m) > solve(W) u v u 0.04255319 -0.06382979 v -0.06382979 0.19574468

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

Chapter 1:

What Is R?

5

> t(solve(W)) u v u 0.04255319 -0.06382979 v -0.06382979 0.19574468

6. How many of the apartments in the VIT2005 data frame, part of the PASWR2 package, have a totalprice greater than e 400,000 and also have a garage? Use a single line of R code to determine the answer. Solution: There are 6 apartments with a totalprice greater than e 400,000 that also have a garage.

> dim(VIT2005[VIT2005$totalprice >=400000 & VIT2005$garage >=1, ])[1] [1] 6

7. Wheat harvested surface in Spain in 2004: Figure 1.1, made with R, depicts the autonomous communities in Spain. The Wheat Table that follows gives the wheat harvested surfaces in 2004 by autonomous communities in Spain measured in hectares. Provide R code to answer all the questions.

Asturias

Cantabria Pais Vasco

Galicia

Navarra Rioja Castilla−Leon

Aragon

Cataluna

Madrid

Extremadura

Castilla−la Mancha Communidad Valenciana

Baleares

Murcia Andalucia

Canarias

FIGURE 1.1: Autonomous communities in Spain

https://gioumeh.com/product/probability-and-statistics-with-r-solutions/

6

Probability and Statistics with R, Second Edition: Exercises and Solutions Wheat Table community Galicia Asturias Cantabria Pa´ıs Vasco Navarra La Rioja Arag´on Catalu˜ na Islas Baleares

wheat.surface

community

wheat.surface

18817 Castilla y Le´on 65 Madrid 440 Castilla-La Mancha 25143 C. Valenciana 66326 Regi´on de Murcia 34214 Extremadura 311479 Andaluc´ıa 74206 Islas Canarias 7203

619858 13118 263424 6111 9500 143250 558292 100

(a) Create the variables community and wheat.surface from the Wheat Table in this problem. Store both variables in a data.frame named wheatspain. (b) Find the maximum, the minimum, and the range for the variable wheat.surface. (c) Which community has the largest harvested wheat surface? (d) Sort the autonomous communities by harvested surface in ascending order. (e) Sort the autonomous communities by harvested surfaces in descending order. (f) Create a new file called wheat.c where Asturias has been removed. (g) Add Asturias back to the file wheat.c. (h) Create in wheat.c a new variable called acre indicating the harvested surface in acres (1 acre = 0.40468564224 hectares). (i) What is the total harvested surface in hectares and in acres in Spain in 2004? (j) Define in wheat.c the row.names() using the names of the communities. Remove the community variable from wheat.c. (k) What percent of the autonomous communities have a harvested wheat surface greater than the mean wheat surface area? (l) Sort wheat.c by autonomous communities’ names (row.names()). (m) Determine the communities with less than 40,000 acres of harvested surface and find their total harvested surface in hectares and acres. (n) Create a new file called wheat.sum where the autonomous communities that have less than 40,000 acres of harvested surface are consolidated into a single category named “less than 40,000” with the results from (m). (o) Use the function dump() on wheat.c, storing the results in a new file named wheat.txt. Remove wheat.c from your path and check that you can recover it from wheat.txt. (p) Create a text file called wheat.dat from the wheat.sum file using the command write.table(). Explain the differences between wheat.txt and wheat.dat. (q) Use the command read.table() to read the file wheat.dat....


Similar Free PDFs