Question

In: Statistics and Probability

Please use R software to do the following study.: Conduct a short study on the performance...

Please use R software to do the following study.:

Conduct a short study on the performance of the 1 sample t-test under the following settings

Setting 1:

Ho: mu=20 Ha: mu<>20

n=30

True distribution is normal with mean=20, sd=3

Setting 2:

Ho: mu=20 Ha: mu<>20

n=10

True distribution is normal with mean=20, sd=3

Setting 3:

Ho: mu=20 Ha: mu<>20

n=30

True distribution is exponential with parameter lamda=1/20 (mean=20)

Setting 4:

Ho: mu=30 Ha: mu<>20

n=10

True distribution is exponential with parameter lamda=1/20 (mean=20)

The report should answer the following question:

In which settings is the one-sample t-test able to retain control over type 1 error?

The report should contain:

Introduction

Methodology

Results

Conclusion

Solutions

Expert Solution

Introduction: The one-sample t-test is used to determine whether a sample comes from a population with a specific mean. This population mean is not always known, but is sometimes hypothesized. As a parametric procedure. one sample t-test has some basic assumptions such as observations are independent and continuous, observation come from population parent is normal etc. Here, we test if the statistic from the observed data is consistent with the statistics calculated from data generated under the null hypothesis.

Methodology:

Under certain null hypothesis for a particular model
1 Generate random sample X1 , X2, . . . , Xn from the null distribution or model
2 Compute the test statistic.
3 Repeat S times: T (1 ), T(2), . . . , T(S)
4 check rejection criterion at significance level α.
5 Draw conclusion with varying sample size.

Results

Setting 1.


n=30                         # sample size
mu=20                        # true value of a parameter
sig=3                        # true value of a parameter
y=rnorm(n, mu, sig)          # generate normal random number
sig_y=sqrt(var(y)/n)        # compute standard error
mu_y=sum(y)/n                # compute estimator
tobs=(mu_y-mu)/sig_y         # compute test statistic
tobs
ifelse(abs(tobs)>qnorm(0.95),"Reject", "Accept" )

Accept

Setting 2.


n=10                         # sample size
mu=20                        # true value of a parameter
sig=3                        # true value of a parameter
y=rnorm(n, mu, sig)          # generate normal random number
sig_y=sqrt(var(y)/n)        # compute standard error
mu_y=sum(y)/n                # compute estimator
tobs=(mu_y-mu)/sig_y         # compute test statistic
tobs
ifelse(abs(tobs)>qt(0.05,n-1),"Reject", "Accept" )

Reject

Setting 3.


n=30                         # sample size
ld=1/20                        # true value of a parameter
y=rexp(n, ld)         # generate normal random number
sig_y=sqrt(var(y)/n)        # compute standard error
mu_y=sum(y)/n                # compute estimator
tobs=(mu_y-20)/sig_y         # compute test statistic
tobs
ifelse(abs(tobs)>qnorm(0.95),"Reject", "Accept" )

Accept

Setting 4

n=10                         # sample size
ld=1/20                        # true value of a parameter
y=rexp(n, ld)         # generate normal random number
sig_y=sqrt(var(y)/n)        # compute standard error
mu_y=sum(y)/n                # compute estimator
tobs=(mu_y-20)/sig_y         # compute test statistic
tobs
ifelse(abs(tobs)>qt(0.95,n-1),"Reject", "Accept" )

Accept

Settings 2 is the one-sample t-test able to retain control over type 1 error.


Related Solutions

Please do all parts! Do not use statistics software. I want to see the formulas. study...
Please do all parts! Do not use statistics software. I want to see the formulas. study of the effect of caffeine on muscle metabolism used 24 male volunteers who each underwent arm exercise tests. 12 of the men were randomly selected to take a capsule containing pure caffeine one hour before the test. The other men received a placebo capsule. During each exercise the subject's respiratory exchange ratio (RER) was measured. (RER is the ratio of CO2 produced to O2...
I want this to be solved using R studio or R software, please. Here is the...
I want this to be solved using R studio or R software, please. Here is the example: The data in stat4_prob5 present the performance of a chemical process as a function of sever controllable process variables. (a) Fit a multiple regression modelrelating CO2product (y) to total solvent (x1) and hydrogen consumption (x2) and report the fitted regression line. (b) Find a point estimatefor the variance term σ2. (c) Construct the ANOVA tableand test for the significance of the regression using...
Please use Statistical Software R Consider a dataset called fandango in fivethirtyeight package: Identify the Top...
Please use Statistical Software R Consider a dataset called fandango in fivethirtyeight package: Identify the Top 5 best rated and Top 5 worst rated movies based on rottentomatoes. Identify the Top 5 best rated and Top 5 worst rated movies based on the average of three users’ scores (rottentomatoes_user, metacritic_user, and imdb). Visualize the difference between Fandango stars and actual Fandango ratings. Comment on what you see. Construct a formal test to see if there is a significant difference between...
Q3. Please use R software to solve this. A confidence interval having 100(1 − α)% confidence...
Q3. Please use R software to solve this. A confidence interval having 100(1 − α)% confidence for normally distributed data is formed by y ± zα/2σ / √n. (That's actually y-bar in the expression, not y). Generate 500 records of 10 columns of normal data with mean 50 and standard deviation 10. Generate two more columns using the confidence bounds expression to give a lower and upper bound consistent with a 95% confidence interval, using each record as a sample...
Please use the p value approach to conduct a hypothesis test for the following problem. Please...
Please use the p value approach to conduct a hypothesis test for the following problem. Please provide detailed solutions in the four steps to hypothesis testing. The security department of a factory wants to know whether the true average time required by night guard to walk his round is 30 minutes. If, in a random sample of 45 rounds, the night guard averaged 30.9 minutes with a`standard deviation of 1.8 minutes, determined whether this is sufficient evidence to reject the...
PLEASE WRITE IN R CODE. Has to output on R software. (1) The stem length of...
PLEASE WRITE IN R CODE. Has to output on R software. (1) The stem length of soybeans from an experiment are: 20.2, 22.9, 23.3, 20.0, 19.4, 22.0, 22.1, 22.0, 21.9, 21.5, 20.9 a. Create a histogram to visualize the data b. Test "t.test" whether the population mean is different from 22 c. Obtain a 2 sided 98% confidence interval on the true mean using "t.test". d. The researcher, by using "t.test" on a sample size of 11 was assuming that...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2 Suppose that fasting plasma glucose concentrations (FPG) in some population are normally distributed with a mean...
Please use the p-value approach to conduct a hypothesis test for the following problem. Please provide...
Please use the p-value approach to conduct a hypothesis test for the following problem. Please provide detailed solutions in the four steps to hypothesis testing. The security department of a factory wants to know whether the true average time required by the night guard to walk his round is 30 minutes. If, in a random sample of 45 rounds, the night guard averaged 30.9 minutes with a standard deviation of 1.8 minutes, determine whether this is sufficient evidence to reject...
GAGE R & R EXERCISE in this example, we do a gage R&R study on two...
GAGE R & R EXERCISE in this example, we do a gage R&R study on two data sets: one in which measurement system variation contributes little to the overall observed variation (GAGEAIAG.MTW), and one in which measurement system variation contributes a lot to the overall observed variation (GAGE2.MTW). For comparison, we analyze the data using both the ANOVA and the Xbar and R method. The GAGEAIAG data was taken from Measurement Systems Analysis Reference Manual, 3rd edition. (Chrysler, Ford, General...
Use R studio to answer the following. A study was carried out to investigate the variation...
Use R studio to answer the following. A study was carried out to investigate the variation of rainbow trout weights in a certain creek. The weights (in kilograms) of 10 randomly selected fish are listed below:       0.78, 0.45, 0.35, 0.76, 0.57, 0.42, 0.33, 0.68, 0.66, 0.42 Assume that the population is approximately normally distributed.  Hint: make a vector to enter the weight data into R, e.g.: > wt = c(0.78, ..., 0.42) Find the 90% confidence interval for the unknown population...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT