Calculate a location statistic

Assignment Help Applied Statistics
Reference no: EM131000824

1. This question concerns the use of R to address mathematical questions. For each problem below include your code in the report as well as answering the questions posed.

(a) The following R code generates a function which checks whether a positive integer under 500 000 000 is a cube number (i.e. a number for which the cube root is also an integer).

cubetest<-function(x){
b<-round(x^(1/3),digits=6)
if(b 1==0){return("Cube number")
} else {
return("Not a cube number")
}
}

(i) Why might the function round be necessary? (HINT: different versions of R operate differently, as you saw in Practical 1.)

(ii) Write a function which has as its input a vector where each element is a positive integer below 500 000 000, and which returns each element of the input vector which is a cube number.

Fermat's last theorem suggests, in part, that there are no positive integer solutions to the equation X3 + Y 3 = Z3. In other words, if
X, Y, Z ∈ Z+, X3 + Y 3 = Z3 is never true.

(iii) Write a function with two inputs X and Y that can tell you whether the sum of X3 and Y 3 is a cube number so long as that sum is under 500 000 000.

(iv) By using the functions you have already written, or otherwise, write code that proves that if X ∈ {1, . . . , 100} and Y ∈ {1, . . . , 100}, there is no Z ∈ Z for which X3 + Y 3 = Z3.

(b) Constructive criticism is possible even here. Identify up to three weaknesses in the code you have wrtitten for part (a), and suggest a possible improvement. You do not need to explain exactly how such a solution would be coded. Consider, for instance, efficiency (could the same information be obtained with less computation) and robustness (could things go wrong, and how might these difficulties be avoided?)

2. Carl the clinician acquires data on the number of people who suffered se- vere trauma in forest fires in the West Midlands in the years 1995 and 2015. This data is available in the file AP1Data.csv which can be down- loaded at the ST104 webpage. Download this data and enter it into R. There are 52 data points for each year, each data point gives the number of people who suffered severe trauma due to a forest fire in the West Mid- lands during that week. The first week is 1st-7th January, the 52nd week is 24th-30th December, with figures for the 31st December not recorded.

(a) Calculate a location statistic and a scale statistic for the 1995 data and the 2015 data, justifying your choice of location statistic and scale statistic in each case.

(b) Represent this data with a graph or graphs, justifying your choice of graph type.

(c) A newspaper article based on the data Carl collected makes the fol- lowing two claims:

(i) The number of cases of severe trauma due to forest fires in the West Midlands has increased between 1995 and 2015.

(ii) This increase is due to global warming making forests warmer and more dry, and so more suspectible to catching fire.
Comment critically on whether either of these statements is sup- ported by the data, giving reasons.

(d) A statistician studying the data suggests the 1995 data and the 2015 data might be distributed according to an unusual distribution. This distribution is a combination of a Bernoulli distribution, X ∼ Ber(p) and a normal distribution, Y ∼ N (µ, σ2). The random variable Z
for the combined distribution behaves as follows:

(X = 1) ⇒ Z ∼ Y
(X = 0) ⇒ Z = 0

In other words Z is normally distributed each time X = 1, and Z = 0 each time X = 0. The statistician suggests the values of p, µ and σ for the year 1995 might be different to the equivalent values for the year 2015.

(i) Estimate the value of p for 1995, and for 2015.

(ii) Comment critically on whether the data for either year has the shape you would expect for data drawn from this distribution.

3. A regular user of the phone banking facilities at Freedonia National Bank sends in a complaint to say that this phone banking facility has become much worse in recent weeks compared to how it used to be. To support his objection the customer attaches data he has compiled regarding how long it took the bank to answer his calls in January 2016 compared to how long it took them to answer his calls during 2015.

Each data point represents a single phone call, and gives the time it took for the customer to speak to a customer service operator. The data can be found in the PhoneBanking.xlsx file at the ST104 website. Enter this data into R.

(a) Produce a figure containing two boxplots which allows you to com- pare the distribution of marks within each group.

(b) Comment on any features of the distributions which you can see from your plot or from any appropriate statistics you decide to calculate. Provide possible explanations for any interesting features.

(c) Based upon this preliminary analysis, to what extent do you think the data supports the customer's view?

(d) Comment critically upon all parts of this analysis. You may wish to consider the following points (among others):

• Are there any potential issues with the data itself?
• How appropriate are the plots used here?
• What weaknesses does what has been done here suffer from?
• What would you do differently if given the opportunity to answer this question using more/different data?

Reference no: EM131000824

Questions Cloud

Equilibrium of price-quantity-consumer and producer surplus : Equilibrium of Price/Quantity/Consumer Surplus/Producer Surplus? If a tax is introduced and it is $1 per unit, what are the new Price/Quantity/Consumer Surplus/ Producer Surplus/ tax revenues? What is the deadweight loss of the tax?
Network consultation proposal and network consultation prese : DesignIT is a graphic arts company that, up until now, had contracted work out to temporary design services. The new space will allow them to hire two (2) full time designers and a receptionist.
The importance of wearing your seatbelt : Statement must propose an arguable solution to a problem related to your major - THE IMPORTANCE OF WEARING YOUR SEATBELT.
Porpose stage of non coorporative movement : A what were the porpose stage of non coorporative movement according to mahatma gandhisk?
Calculate a location statistic : Why might the function round be necessary - Write a function which has as its input a vector where each element is a positive integer- Calculate a location statistic and a scale statistic for the 1995 data and the 2015 data, justifying your choice o..
What rate does the pump supply heat to the building : A perfectly reversible heat pump supplies to a building to maintain its temperature at 27oC. The cold reservoir is a river at 7oC. If work is supplied to the pump at the rate of 1 kW, at what rate does the pump supply heat to the building?
Show that the angle dbx is equal to the angle xbl : Let ABC be a triangle such that angle B is a right angle. Let L be the midway point of the side AC. Show that the angle DBX is equal to the angle XBL.
What is the mass of the unknown mass in kg : you performed an experiment with a spring to find the mass of an "unknown mass." If the spring constant is 9.94 N/m and the "unknown mass" caused a displacement of Δ16.1 cm, what is the mass of the "unknown mass" in kg?
What angular speed would we have to spin the coil : One way to do this would be to spin a metal loop about an axis perpendicular to Earth's magnetic field. Suppose that the metal loop is a square that is 45.0 cm on each side and that we want to generate a potential in the loop of amplitude 125 V at..

Reviews

Write a Review

Applied Statistics Questions & Answers

  Degraded state is detected with probability 0.9

Degraded state is detected with probability 0.9 (failed state with probability 1) and repair occurs in both degraded and failed states. Repair starts immediately upon detection of the failed or degraded state and restores the system to the oper..

  Calculate this seasonal adjustment index

Calculate this seasonal adjustment index if i have 14 periods instead of 16 periods needed?

  Compare and contrast internal and external validity

Compare and contrast internal and external validity. Describe and give examples of research questions for which external validity is a primary concern. Describe and give examples of research questions in which internal validity is a primary concern. ..

  Describe advantages and disadvantages of quasi-experiments

Describe the advantages and disadvantages of quasi-experiments? What is the fundamental weakness of a quasi-experimental design? Why is it a weakness? Does its weakness always matter?

  Eestimate the fraction of defective parts

The percent defective for parts produced by a manufacturing process is targeted at 4%. The process is monitored daily by taking samples of sizes n = 160 units. Suppose that today's sample contains 14 defectives. How many units would have to be sample..

  Calculate the sample size needed

1. Calculate the sample size needed given these factors: one-tailed t-test with two independent groups of equal size small effect size (see Piasta, S.B., & Justice, L.M., 2010) alpha =.05

  Determine whether fillers initial setup should be readjusted

determine whether the filler's initial setup should be readjusted. In each case, use (1) a critical value, (2) a p-value, and (3) a confidence interval. Assume that s equals .1.

  A period must be used as the decimal point marker

Accepted characters: numbers, decimal point markers (period or comma), sign indicators (-), spaces (e.g., as thousands separator, 5 000), "E" or "e" (used in scientific notation). NOTE: For scientific notation, a period MUST be used as the deci..

  The number of holding penalties assessed has a mean

A study of college football games shows that the number of holding penalties assessed has a mean of 2.3 penalties per game and a standard deviation of penalties per 1.1 game. What is the probability that, for a sample of 40 college games to be played..

  Compare and contrast significance levels and p-values

Compare and contrast significance levels and p-values.

  What is the standard error of estimate

Interpret the coefficients - what does the regression line tell you about the heights of sons of tall fathers - what is the standard error of estimate? Interpret its value.

  The population standard deviations s1 and s2

What two assumptions must be met when you are using the z test to test differences between two means? Can the sample standard deviations s1 and s2 be used in place of the population standard deviations σ1 and σ2?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd