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

  Utilize the meta-analysis procedure

Find TWO peer-reviewed articles that provide examples of studies that utilize the meta-analysis procedure and that were not already discussed by a classmate(s) for this week''s forum discussion. In your own words (i.e., no direct quotes!), briefly de..

  The null hypothesis

Married Adults. In a recent year, 125.8 million adults, or 58.6% of the adult American population, were married. In a New England town, a simple random sample of 1,445 adults includes 56.0% who are married. Use a 0.05 significance level to test..

  The following scores from the original population

1. a population of scores with u=43 and Q=8 is standardized to create a new population with u=50 and Q=10. what is the new value for each of the following scores from the original population? scores: 43,47,55,35

  Calculate the slack time for each activity

Calculate the slack time for each activity and for each path and looking at only the critical path, find the probability that the store will take more than 23 working days to open.

  What is euthyphro second definition of piety

What is Euthyphro's second definition of piety?

  A uniform back-and-forth movement

Suppose a gun sprays paint in a uniform back-and-forth movement, covering an angular sweep between forty five degrees to either side, onto a screen 100cm away. Assume that the distribution of paint at a distance ±x to either side of the centre of the..

  A real estate agent wishes to determine the selling price of

A real estate agent wishes to determine the selling price of residences using the size (square feet), and whether the residence is a condominium or a single-family home. A sample of 20 residences was obtained with the following results: x 233 10 24 5..

  If a and b are independent events

If A and B are independent events which rule do we use? A. P(A or B) = P(A) + P(B) B. P(A and B) = P(A) . P(B)

  Cross tabulation of two variables

Descriptives of a continuous variable: mean, median, skewness, kurtosis, standard deviation and graph of that variable  Cross tabulation of two variables

  A particular department store knows from past experience

A particular department store knows from past experience that 17% of their customers have the store's credit card. What is the probability that out of the next 120 customers that at least 15% have the store's credit card? (please express your answer ..

  Calculating a z-score and graphing a box plot

Calculating a Z-score and graphing a box plot and Statistical Inference of Sample Mean , Binomial Distribution and Regression Analysis

  Briefly interpret the descriptive data analysis

List and explain the variables you would collect in this study. There must be a minimum of three variables and two must meet the assumptions for a correlational analysis.

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