(Use R)The sample data is 30, 37, 36, 43, 42, 43, 43, 46, 41,
42.
Estimate the population mean ? of the underlying distribution by
calculating a
best point estimate and by giving a 80% bootstrap confidence
interval (You
can decide how many resampling you want to do: may be around
10,000)
Sample mean , point estimate of mean of underlying distribution.
For finding, 80% bootstrap confidence interval, following R-code were used, 10000 bootstrap sample are taken.
------------------------------------------------------------------------------------------------------------------------------------
#given sample
x=c(30, 37, 36, 43, 42, 43, 43, 46, 41, 42)
n=length(x)
#sample mean
xbar=mean(x)
nboot=10000
#Generate 10000 bootstrap samples
#random resamples from x
bootdata=sample(x,n*nboot,replace=TRUE)
bootstrap_sample=matrix(bootdata,nrow=n,ncol=nboot)
#Compute the means of bootstrap samples
bootmeans=colMeans(bootstrap_sample)
#Compute delta for each bootstrap sample
delta=bootmeans- xbar
#Find the 0.1 and 0.9 quantile for delta
d=quantile(delta,c(0.1,0.9))
#Calculate the 80% confidence interval for the mean.
ci=xbar- c(d[2],d[1])
print("80% bootstrap confidence interval")
print(ci)
---------------------------------------------------------------------------------------------------------------------------------------------------------
Comments in the codes explains the steps.
The 80% bootstrap confidence interval for distribution mean is .
Get Answers For Free
Most questions answered within 1 hours.