Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First, import the boot package and use boot() to find the R bootstrap of the statistic. To do this, complete the script below. Run R

First, import the boot package and use boot() to find the R bootstrap of the statistic. To do this, complete the script below. Run R = 1000 replicas. The inputs for your boot function will be for iris and corr.fun. Once coded, display the results of the boot function and enter the full observed value of the statistic applied to the data. This value will be labeled as "original" in the returned object. Your value should be less than 1 and contain 7 decimal places (i.e. 0.#######)

The statistic you will be using, corr.fun, has been defined for you. Note that Spearman's correlation in statistics is a nonparametric alternative to Pearson's correlation. Use Spearman's correlation for data that follow curvilinear, monotonic relationships and for ordinal data. Statisticians also refer to Spearman's rank order correlation coefficient as Spearman's (rho)

library(boot)

#Customfunctiontofindcorrelation

#betweenthePetalLengthandWidth

corr.fun<-function(data,idx){

df<-data[idx,]

#Findthespearmancorrelationbetween

#the3rdand4thcolumnsofdataset

c(cor(df[,3],df[,4],method='spearman'))

}

#donotchangetheseed;usedforreproducability

set.seed(42)

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

Essential Calculus Early Transcendental Functions

Authors: Ron Larson, Robert P. Hostetler, Bruce H. Edwards

1st Edition

618879188, 618879182, 978-0618879182

More Books

Students also viewed these Mathematics questions

Question

Environmental education explain?

Answered: 1 week ago

Question

Scope of environmental science short brief ?

Answered: 1 week ago

Question

Ecology and economy ?

Answered: 1 week ago