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

This is R programming question you will see the data from the link data<-read.ta

ID: 3371076 • Letter: T

Question

This is R programming question

you will see the data from the link

data<-read.table("https://www.stat.uw.edu/marzban/390/summer18/inter_arrival_dat.txt", header = F) # 100 observation of 1 variable

Before we do this part, I need to tell you something about read.table(). As mentioned above, read.table() reads things into a table, but a lot of basic R functions ( even mean() ) require their objects to be a matrix. So, it's common to apply the function as.matrix() to the output of read.table(). Recall, that you have already seen another example of as.something function in one of your hw, i.e., as.factor().

Suppose you have recorded the times at which a given website gets clicked/visited, and you are interested in the time between the clicks.

Question from here.

Write code to read in the 100 observations on inter-arrival time in the file inter_arrival_dat.txt, and answer this question: What must the inter-arrival time be to place it among the shortest 10%?

Show transcribed image text

1 1.23162100 2 0.47350180 3 8.42028600 4 0.08218906 5 2.90722300 6 0.63448730 7 0.90775660 8 0.88138040 9 2.16292100 10 0.59446650 11 2.36229600 12 0.14803310 13 7.68529700 14 0.27649990 15 1.96800300 16 4.77880200 17 0.01143186 18 0.32470550 19 2.37886900 20 6.25797500 21 3.07049500 22 0.30877610

Explanation / Answer

########## Header ################
# Title: Inter Arrival Time question for CHEGG
#  
# Description:
# Write code to read in the 100 observations on inter-arrival time in the file inter_arrival_dat.txt.
# What must the inter-arrival time be to place it among the shortest 10%?

# Author: <Chegg Tutor>
# Date: <28-06-2018>

########## End of header ###################

# Set working directory using setwd() function
setwd("C:/_chegg/_inter_arrival")

# Clear all variables in R memory
rm(list=ls())

# Reading DATA from url in R
data <- read.table("https://www.stat.uw.edu/marzban/390/summer18/inter_arrival_dat.txt", header = F) # 100 observation of 1 variable
data_matrix <- data.matrix(data)
write.table(data, file = "inter_arrival_dat.txt", sep = " ", row.names = FALSE, col.names = FALSE)

# 10% of Data
data_matrix_asc <- data_matrix[order(data_matrix),]
result <- data_matrix_asc[(length(data_matrix) * 0.10)]
print(sprintf("Inter-Arrival time has to be less than %0.4f", result))

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