Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This problem asks you to create a list (called \'x2\') of random data values and

ID: 3221125 • Letter: T

Question

This problem asks you to create a list (called 'x2') of random data values and some basic analysis of the list. Again, make sure that you are using the object names EXACTLY as stated here and that the objects are saved to the workspace file that you submit. (a) Use the sample function to create a random list of 400 integers between 1 and 10 (inclusive). Assign this list to the object 'x2' (b) Determine the value of the 202^th integer in this list and assign that value to the object 'x2term' (c) Assign the mean value of this list of numbers to the object 'x2ave'. (d) Assign the standard deviation value of this list of numbers to the object 'x2sd' (e) Add 1600 more random integer values 1 and 10 (inclusive) to the end of and assign that new list object 'x2' and assign that new list of 2000 random integers to the 'x2new' (f) Determine the value of the 1451^st integer in this new list and assign that value to the object "x2newterm' This problem asks you to create a random distribution that is not normal (called 'x4'), analyze a random sample from this distribution, and then to illustrate the Central Limit Theorem by creating a of x values. Oh yeah, you should really make sure that you are using the object names stated here and that the objects are saved in the workspace file that you submit. (a) Assign to the object 'x4' a random distribution of 5000 values using the following R-command > x4 = c(rpois(5000, c (10, 40))) (b) Assign the mean value of the distribution 'x4' to the object 'x4ave'. (c) Assign the standard deviation of the distribution 'x4' to the object 'x4sd'

Explanation / Answer

#a) to create a random list of 400 integers between 1 to 10(inclusive)

x2=sample(c(1:10),400,replace=TRUE,prob=NULL) #we use sample function which in general is sample(x, size,replace=FALSE,prob=NULL)

# here x=c(1:10) indicates that we have to take integers from 1 to 10,size= 400,replace=TRUE implies drawing sample with replacement, probabilty of drawing the samples is not specified here so prpb=NULL

x2 # to see the object x2 which is assigned as a vector here

#b)   
x2term=x2[202] # to obtain the 202th value from the object x2(in general x[i] gives the "i"th element of vector x)
x2term #assigning it to the object "x2term"

#c)   
x2ave=mean(x2) # we use the mean function to calculate the mean of the listed numbers in x2,assigning it to the object "x2ave
x2ave

#d)
x2sd=sd(x2) # we use the sd function to calculate the standard deviation of the listed numbers in x2, assigning it to the object "x2sd"
x2sd

#e)
new=sample(c(1:10),1600,replace=TRUE) #we again use sample function to generate 1600 integers between 1 to 10,here size=1600 and list the numbers in object "new"

x2new=c(x2,new) # to add the newly obtained 1600 integers to the end of x2 and naming the list as "x2new"
x2new # obtaining a list of total 2000 integers

#f)
x2newterm=x2new[1451] #to obtain the 1451th value from the object x2new and assigning it to the object "x2newterm"
x2newterm

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote