Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . From ISLR obtain the Caravan data. Please answer the following questions based on this dataset. Here is what the dataset is: table

1. From ISLR obtain the Caravan data. Please answer the following questions based on this dataset. Here is what the dataset is:
\table[[4,A,B,C,D],[1,Name,Age,Weight,Height],[2,A,1,2,4],[3,B,2,2,2],[4,C,2,4,6.2],[5,D,22,4,6],[6,E,19,185,5.9],[7,T,5,6,7],[8,K,56,76,78],[9,U,7666,8,7]]
a) Name Caravan data as temp1.
b) Find the dimension of Caravan data.
c) Find column names of Caravan data.
d) Find the rows of the Caravan where the Purchase column shows Yes.
e) Find the rows of the Caravan where the Purchase column shows No and the MOSTYPE value isless than 25.
f) Obtain the subset of the Caravan data where the column names include M.
g) Obtain the subset of the Caravan data where the column names start with M.Hint: For this problem, you can use, dplyr library and the following code below.select(temp1,starts_with("M"))
2. For this question, you need to use airquality data. You can access this data from R without anylibrary. This data includes some missing values which are shown as NA in the data set.
a) Find total number of missing values.
b) Find how many missing values are in each column.
c) Delete the rows which contains missing data.
d) Find the rows where Solar.R column includes missing values and remove these rows.
e) Find the rows where Ozone column includes missing values and remove these rows.
f) Find the rows where Solar.R and Ozone columns include missing values and remove these rows.
g) Find the rows where Solar.R or Ozone columns include missing values and remove these rows.
3.Gaussian random numbers. One way to generate a random number taken from the Gaussian distribution is to use the Box-Muller formula:
Z=sin(2v)(-2lnu)12
where u and v are real numbers between 0 and 1 generated by runif(1,0,1)function. Compose a program that writes a standard Gaussian random variable. And calculate Z value.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

d. What language(s) did they speak?

Answered: 1 week ago