Ask Applied Statistics Expert

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?

Applied Statistics, Statistics

  • Category:- Applied Statistics
  • Reference No.:- M91709646
  • Price:- $45

Guranteed 36 Hours Delivery, In Price:- $45

Have any Question?


Related Questions in Applied Statistics

Question onea a factory manager claims that workers at

QUESTION ONE (a) A factory manager claims that workers at plant A are faster than those at plant B. To test the claim, a random sample of times (in minutes) taken to complete a given task was taken from each of the plant ...

You are expected to work in groups and write a research

You are expected to work in groups and write a research report. When you work on your report, you need to use the dataset, and other sources such as journal articles. If you use website material, please pay attention to ...

Assignment -for each of the prompts below report the

Assignment - For each of the prompts below, report the appropriate degrees of freedom, t statistic, p-value and plot using the statistical software platform of your choice (R/STATA) 1) A sample of 12 men and 14 women hav ...

Assignment - research topicpurpose the purpose of this task

Assignment - Research topic Purpose: The purpose of this task is to ensure you are progressing satisfactorily with your research project, and that you have clean, useable data to analyse for your final project report. Ta ...

Assessment task -you become interested in the non-skeletal

Assessment Task - You become interested in the non-skeletal effects of vitamin D and review the literature. On the basis of your reading you find that there is some evidence to suggest that vitamin D deficiency is linked ...

Part a -question 1 - an analyst considers to test the order

PART A - Question 1 - An analyst considers to test the order of integration of some time series data. She decides to use the DF test. She estimates a regression of the form Δy t = μ + ψy t-1 + u t and obtains the estimat ...

Medical and applied physiology experimental report

Medical and Applied Physiology Experimental Report Assignment - Title - Compare the working and spatial memory by EEG. 30 students were tested (2 memory games were played to test their memory - a card game and a number g ...

Business data analysis computer assignment -part 1

Business Data Analysis Computer Assignment - PART 1 - Economists believe that high rates of unemployment are linked to decreased life satisfaction ratings. To investigate this relationship, a researcher plans to survey a ...

Question - go to the website national quality forum nqf

Question - Go to the website, National Quality Forum (NQF), located in the Webliography, and download the article by WIRED FOR QUALITY: The Intersection of Health IT and Healthcare Quality, Number 8, MARCH 2008. You are ...

Go to the webliography source for the national cancer

Go to the Webliography source for the National Cancer Institute's Surveillance, Epidemiology, and End Results (SEER) Program. In the Fast Stats, create your own cancer statistical report, "Stratified by Data Type," and u ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As