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

  What is the test value that she would compute?

A medical doctor wishes to test the claim that the standard deviation of the systolic blood pressure of deep sea divers is greater than 450. To do so, she selected a random sample of 25 divers and found s = 468. Assuming that the systolic blood press..

  What is the variable cost per unit produced

Use these data to develop an estimated regression equation that could be used topredict the total cost for a given production volume and what is the variable cost per unit produced

  Dependent t test

Dependent t test

  What is the standard error of his prediction

What is the standard error of his prediction?

  Forensic collection and analysis of persistent data

Write up your lab experience including: the necessary steps (broadly, not detail with keystrokes) to collectpersistent data, the ease of use of the software

  A business man must travel to five different destinations

A business man must travel to five different destinations

  What conclusion can you draw about the juggling class

A study was conducted to test the effectiveness of a juggling class. Before the class started, six subjects juggled as many balls as they could at once. After the class, the same six subjects juggled as many balls as they could. The differences in th..

  Find the probability that the sales representative makes

Find the probability that the sales representative makes

  What differentiates the two formulas

What differentiates the two formulas Σ (x - xbar)^2/n-1 from Σ (x - µ)^2/n, and why the difference?

  The production manager for the xyz manufacturing company

The production manager for the XYZ manufacturing company

  Construct a frequency bar chart for the given data

Construct a frequency bar chart for these data. Construct a pie chart for these data. Which professional sports league is most popular with these 50 adults? Which is least popular?

  A sample is drawn in the following manner with total sample

A researcher wants to compare the testosterone levels among athletes in four sports: soccer, track, Lacrosse, and water polo. A sample is drawn in the following manner with total sample size was n =30 (10 soccer, 10 track, 5 Lacrosse, and 5 water pol..

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