SCIE4401: Data Use in Science - Cumulative Distribution - R Programming Assignment Help

Download Solution Order New Solution
Internal Code: 6CIJH

R Programming Assignment Help

Task: SOME BASIC R COMMANDS Add clear and concise comment lines to the following set of instructions to describe what each line is accomplishing. You can place the comment line above the command it refers to if you wish. s1 = c(5,11,43,25,67,99,12,34,55,64) # ... comments ... s2 = seq(10,300,by=20) # ... comments ... m = matrix(nrow=2,ncol=5) # ... comments ... quantile(s1) # ... comments ... sd(s2) # ... comments ... var(s2) # ... comments ... s3 = seq(3,12,length.out=30) # ... comments ... pnorm(0.5,lower.tail=FALSE) # ... comments ... s4 = s3[c(10,15,20)] # ... comments ... s4 = s3[-c(20,24:28)] # ... comments ...
  1. The ’tree91.wk1’ described in one of the online tutorials (here) has been downloaded and most of it is available with this assignment as a CSV file (’tree91.csv’). Explain how you would: read in the data file into R; list the names of the variables in the data set; and identify its dimensions (rows/columns). You can learn about data input options (including reading files) in the same tutorial. Use the file provided with this assignment (”trees.csv”), not the one directly downloaded from the the web link above as the two files are not exactly the same.
  2. For the above data set, cross tabulate the carbon (C) against nitrogen (N) values using the ’table()’ R command. (This command is described in the online tutorial.) Present the script line you used below. What does the cross-tabulation indicate about the C and N values? What N values are most common? What C values are most common? Do N and C appear to be correlated according to the cross-tablulation results?
LOOPS Create a 4x5 matrix and use a double loop to populate it with numbers so that the value of an element in the matrix is its row index raised to the power of its column index (e.g. the value of the element in row 2 and column 3 is 2 raised to the power of 3, i.e. 8).
  1. DISTRIBUTION VALUES
Use the ’seq’ command to generate a set of 12 figures (call the vector ’q’) equally spaced between -3 and 4. Calculate the cumulative distribution (pnorm) values (’p’) at each of these values. Plot ’p’ against ’q’. (Three lines of R code required).
  1. DISTRIBUTION VALUES – NORMAL
What is the probability that a value randomly drawn from a normal distribution with a mean of 5 and a standard deviation of 1.5 is below 2.5 or above 6.5? (Three lines of R code; but you can also do it in one line if you wish).
  1. DISTRIBUTION VALUES – t-Distribution
What is the probability that a value randomly drawn from a t-distribution is between 1.2 and 3.5, if the degrees of freedom value is 12? (Three lines of R code; but you can also do it in one line if you wish).
  1. RANDOM NUMBERS – t-Distribution
Draw 10000 random numbers from a t-distribution with a degrees of freedom value of 16. Make a histogram with 40 intervals. (Two lines of R code). One of the places where you can learn about basic plots including histograms is the online tutorial here.
  1. SCATTER PLOTS WITH LEGENDS
Consider the following three vectors (X, Y, and Z). X: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 Y: 110, -99.59, -95.33, -93.62, -90.84, -92.87, -78.96, -70.30, -48.20, -26.29, 20.98, 93.12, 218.08, 413.57, 729.16 Z: 90, 3.975368 , 3.49, 7.06, 5.10, 9.21, 14.24, 21.72, 27.94, 43.02, 61.08, 84.60, 122.02, 181.75, 274.65 Make a scatter plot of Y against X. Add a scatter plot of Z against X to the same chart, using the ’points’ R command. Add a legend identifying the two plots, ”Y vs X” and ”Z vs X”.
  1. USING LOGICAL OPERATORS
Provide the R script commands that you would use to do the following exercises and the results obtained from running those commands.
  1. a) Load into R the data in the file ’grades.csv’.
  2. b) Calculate the percentage of students with grades between 55% and 75% (inclusive) using one line of R code. To select rows, consider using the ’which()’ R command.
  3. c) Calculate the median grade for students scoring between 50% and 70% (inclusive). d) Extract a smaller table including only the ’hours’ and ’grade’ columns from the grades data frame.
This SCIE4401: R Programming Assignment has been solved by our R Programming experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.