Answer the following bootstrap question by showing the R code :
A set of data X contains the following numbers:
119.7 104.1 92.8 85.4 108.6 93.4 67.1 88.4 101.0 97.2
95.4 77.2 100.0 114.2 150.3 102.3 105.8 107.5 0.9 94.1
We generated n = 20 observations Xi = 10 Wi+100, where Wi has a contaminated normal distribution with proportion of contamination 20% and σc = 4.
Suppose we are interested in testing:
H0 : μ = 90 versus H1 : μ > or <90 .
(a) Determine the bootstrap p-value for this situation.
(b) Using R Program to Compute the p-value based on 3000 bootstraps and show the R code.
My R codes always give me the P value =0. What's wrong with it?
m <- 90
x <- c(119.7, 104.1, 92.8, 85.4, 108.6, 93.4, 67.1, 88.4, 101,
97.2, 95.4, 77.2, 100, 114.2, 150.3, 102.3, 105.8, 107.5, 0.9, 94.1
)
boottestonemean <- function(x,m,b){
n<-length(x)
m=90
b=3000
v <- mean(x)
z <- x - mean(x) + 90
counter <- 0
teststatall <- rep(0,b)
for(i in 1:b){xstar <- sample(z, n, replace=TRUE)
vstar <- mean(xstar)
if(vstar > v)
{counter <- counter+1}
teststatall[i]<-vstar}
pvalue <- counter/b
list(origtest=v,pvalue=pvalue,teststatall=teststatall)
}
Use R program.
In: Statistics and Probability
There are no results for Drugs of Abuse Mr. V, a 47 year-old man, was recently promoted as a director of a transportation company. A routine inspection of the books shows that a large sum of money is missing. Subsequent investigation finds that Mr. V has been spending more than $20,000 a month to buy cocaine; currently he consumes 2-3 g/d. He also drinks several beers each day and 5-8 shots of vodka in the evening. He spends weekend nights in clubs, where he often consumes 2-3 pills of ecstasy. He began using drugs at age 18; during parties he mostly smoked cannabis (5-6 joints per weekend), but also tried cocaine. This “recreational use” came to an abrupt halt when he married at age 27 and entered a professional training program that allowed him to obtain his current job, now jeopardized by his cocaine use. 1. Is Mr. V addicted, dependent, or both? Explain your reasoning. (5points) 2. What is the reason for the use of several different addictive drugs at the same time? (5points) 3. Exogenous cannabinoids (marijuana) include several pharmacologically active substances, but the main psychoactive alkaloid is called __________________________. (2points) 4. When CB1 receptors are activated by marijuana it produces several effects. List at least 3 of the effects. (3points) 5. Ecstasy is a psychoactive drug primarily used for recreational purposes. Ecstasy increases the activity of three brain chemicals. Describe the three brain chemicals that it increases. (5points)
In: Nursing
2
Let u,v, and w be vectors, where u=(1,2,3,-1), v=(2,3,1,5) and
w=(3,5,4,4).
2.1
Construct a basis for the vector space spanned by u, v and w.
2.2
Show that c=(1,3,2,1) is not in the vector space spanned by the
above vectors u,v and w.
2.3
Show that d=(4,9,17,-11) is in the vector space spanned by the
above vectors u,v and w, by expressing d as a linear combination of
u,v and w.
In: Advanced Math
If u(t) = < sin(8t), cos(4t), t > and v(t) = < t, cos(4t), sin(8t) >, use the formula below to find the given derivative.
d/(dt)[u(t)* v(t)] = u'(t)* v(t) + u(t)* v'(t)
d/(dt)[u(t) x v(t)] = <.______ , _________ , _______>
In: Math
If u(t) = < sin(5t), cos(5t), t > and v(t) = < t, cos(5t), sin(5t) >, use the formula below to find the given derivative.
d/dt[ u(t) * v(t)] = u'(t) * v(t) + u(t)* v'(t)
d/dt [ u(t) x v(t)] = ?
In: Advanced Math
Question 1
Consider the population of history scores for a class comprising 5 students A, B, C, D and, E. The marks are as follows:
Student A B C D E
Score 70 78 80 80 95
(a) List the 10 possible samples of 3 from the 5 students, A, B, C, D and E.
(b) Find the sample mean for each of the 10 samples.
(c) Find the mean of the 10 sample means.
Question 2
Assume that a human pregnancy has a population mean of 280 days and a population standard deviation of 8 days. Determine the following probabilities:
(a) The probability that one randomly chosen pregnant woman exceeds 284 days before giving birth.
(b) We take a random sample of n = 5 pregnant women. Find the probability that the mean number of days for this group of 5 women exceeds 284 days.
(c) Compare your answers for parts a) and b). Why are they different?
(d) What was the value of the standard error for part a)? For part (b)? Why are these different?
Question 3
In a random sample of forty-eight 200-metre swims has a mean time of 3.12 minutes and a standard deviation of 0.09 minutes.
(a) Construct the 89% confidence interval for the population mean time.
(b) If all the other quantities remain the same, how does the indicated change affect the width of the confidence interval?
(i) Increase in the sample size
(ii) Increase in the level of confidence.
Question 4
In a sample of 400 shops it was discovered that 136 of them sold carpets at below the list prices, which had been recommended by manufacturers.
(a) Estimate the percentage of all carpet selling shops below list price.
(b) Calculate the 95% confidence limits for this estimate.
In: Statistics and Probability
A +7.50 μC point charge is sitting at the origin.
What is the radial distance between the 500 V equipotential surface and the 1000 V surface?
What is the distance between the 1000 V surface and the 1500 V surface?
In: Physics
A +7.50 μC point charge is sitting at the origin.
What is the radial distance between the 500 V equipotential surface and the 1000 V surface?
What is the distance between the 1000 V surface and the 1500 V surface?
In: Physics
1) True or False?
In multinomial logistic regression analysis, the model fit is given by the value of R-squared.
In linear regression analysis, the overall significance test is an F test.
In logistic regression analysis, the overall significance test is an F test.
When building a model for regression analysis, the type of data for the outcome variable
guides you to choose linear, logistic, or multinomial logistic.
Two variables that covary might not have a causal relationship.
Causation implies correlation.
2) Which one should be analyzed by multinomial logistic regression analysis? Select all correct cases.
1) Dependent V: Attitude toward immigration policy (strongly agree/agree/disagree/strongly
disagree). Independent V: Gender (female/male).
2) Dependent V: College major (Business/Biology/Economics/Psychology). Independent V:
High school GPA (points)
3) Dependent V: Individual preference about automobile brand (Ford/Kia). Independent V: Age
4) Dependent V: A country’s trade policy (low tariff/moderate tariff/high tariff). Independent V: GDP ($)
5) None of them is correct.
3) Which one should be analyzed by logistic regression analysis? Select all correct cases. No partial credit is given.
1) Dependent V: Attitude toward gun policy (Agree/Disagree). Independent V: Gender (female/male).
2) Dependent V: College major (Business/Economics/Psychology). Independent V: Father’s major (Business/Economics/Psychology)
3) Dependent V: Individual preference about automobile brand (Ford/Kia). Independent V: Age
4) Dependent V: Starting salary (QAR). Independent V: College major (Business/Biology)
5) None of them is correct.
In: Statistics and Probability
Foreign currency analysis of NVIDIA Corp which is an American technology company which is based in Santa Clara, California. Nvidia now operates broadly as a visual computing company and serves its customers in two primary segments: GPU (graphics processing units) and Tegra processors Explain the business activities and environment of NVIDIA Corp from the perspective of foreign currency and identify three currencies that NVIDIA Corp is exposed against. This can be due to its business structure (i.g. location of factories, customers and suppliers, and the currency that the products/services are quoted), and arising from the competition against its rivals. State the rationales of your selection and references.
In: Finance