Why can we just calculate the maximum value

Assignment Help Applied Statistics
Reference no: EM131549323

Data Technologies

The point of this lab is to get started using R and to practice reading text file data into R and calculating simple summaries from data.

Your answer will consist of a file containing R code; you can submit either a plain text file containing R code or a plain text file containing R markdown code. Please DO NOT submit anything other than a plain text file (e.g., DO NOT submit a Word document or a PDF document or an HTML document).

We will work with three CSV files called trump-tweets-num-2010.csv, trump-tweets-num- 2011.csv, and trump-tweets-num-2012.csv that contains data on tweets from the Twitter ac- count of Donald Trump (from 2010 to 2012).

Within these files, every row provides information for one of Donald Trump's tweets, mostly about when the tweet was sent (wday is day of the week, min is minutes, and sec is seconds), but also how many times the tweet was retweeted. The first few rows of the file trump-tweets-num-2010.csv are shown in Figure 1.

The data files are available on Canvas.

retweet_count,month,day,wday,hour,min,sec

144,11,30,4,21,42,1

109,11,23,4,16,26,18

112,11,16,4,14,30,23

250,11,14,2,20,55,30

12,11,13,1,16,42,27

14,11,13,1,16,39,7

24,11,13,1,16,30,47

44,11,10,5,14,42,15

55,11,9,4,20,2,3

24,11,2,4,15,32,49

31,10,29,1,15,52,46

69,10,24,3,18,41,32

32,10,24,3,17,20,54

19,10,24,3,15,53,23

26,10,22,1,17,22,23

21,10,18,4,17,11,35

27,10,18,4,15,45,35

34,10,15,1,19,42,7

28,10,11,4,15,20,8

Figure 1: The first few lines of the file trump-tweets-num-2010.csv.

NOTE: You should submit a file containing R code that assigns values to the appropriate symbols. I will run the code in your file and then check the values that have been assigned to the symbols.

NOTE: Your file should ONLY contain valid R code, properly indented, and with comments. You should be able to copy-and-paste your entire file of R code into R and get no errors.

NOTE: You should submit your answers on Canvas.

1. Write an R expression that reads the file trump-tweets-num-2010.csv and assigns the result to the symbol tweets2010.
NOTE: your code can assume that the data file is in the current working directory. The symbol tweets2010 should print like this:
> head(tweets2010)

 

retweet_count

month

day

wday

hour

min

sec

1

144

11

30

4

21

42

1

2

109

11

23

4

16

26

18

3

112

11

16

4

14

30

23

4

250

11

14

2

20

55

30

5

12

11

13

1

16

42

27

6

14

11

13

1

16

39

7

>dim(tweets2010)

2. Write an R expression that calculates the maximum value from the file trump-tweets-num- 2010.csv and assigns the result to the symbol maxRetweet2010.

The symbol maxRetweet2010 should print like this:

[1] 3813

Some things to think about:
 Why can we just calculate the maximum value for the whole file, rather than having to focus just on the retweet_count column?
 Is this calculation inefficient? Does it matter?

3. Write R code to calculate the largest number of retweets across all three files.
Assign your answer to the symbol maxRetweet. You should get a result that prints like this:
> maxRetweet

[1] 141644

Some things to think about:

 How unusual is this retweet value?
 How would you find out how unusual it is?

4. Write R code to calculate the latest time (before midnight), in seconds, that Donald Trump sent out a tweet.

Assign your answer to the symbol maxTweetTime. You should get a result that prints like this:
> maxTweetTime

[1] 86290

Some things to think about:

 Why did I specify "before midnight"?
 How would you convert this value into hours, minutes, and seconds?

 [EXTRA for EXPERTS - NO MARKS]

Write R code that shows the complete row of data for the latest (before-midnight) tweet ...

retweet_count month day wday hour min sec 86 25 5 5 6 23 33 42

.. and write code to produce a message that states the latest time (before midnight), including the date, that Donald Trump sent out that tweet ...

Donald's latest (pre-midnight) tweet was at 23:33:42 on Wednesday 05 May

Reference no: EM131549323

Questions Cloud

How each one fits into a risk management strategy : Create a written report consisting of at least three pages in which you describe the purposes and benefits of each one, the challenges involved in creating.
Entities deserve moral consideration : Assess the arguments we examined for whether we need to expand our conventional moral framework to include at least some AI entities?
Pros and cons of online communities : Describe some pros and cons of online communities.
Write a paper discussing role the computer security act play : Research the following laws that relate to computer crime. Write a 12-16 page paper discussing the role The Computer Security Act play in computer crime.
Why can we just calculate the maximum value : Lab Session 7 STATS 220- Why can we just calculate the maximum value for the whole file, rather than having to focus just on the retweet_count column?
Discuss the thecb accountability system : In the article, Differences in Black faculty rank in 4-year Texas Public Universities: A multi-year analysis by Jones and Slate (2014).
What is the demographic factors : Within the article, College Major Choice in STEM: Revisiting Confidence and DemographicFactors, by Moakler and Kim (2014), the researchers sought to determine.
How does a cirt plan help an organization mitigate risk : How does a CIRT plan help an organization mitigate risk? Which step in the CIRT response methodology requires proper handling of digital evidence?
Es technology in professional ?elds : In our discussion of expert systems (ESs) we saw that the increased use of ES technology in professional ?elds has generated some ethical and social concerns.

Reviews

Write a Review

Applied Statistics Questions & Answers

  Hypothesis testing

What assumptions about the number of pedestrians passing the location in an hour are necessary for your hypothesis test to be valid?

  Calculate the maximum reduction in the standard deviation

Calculate the maximum reduction in the standard deviation

  Calculate the expected value, variance, and standard deviati

Calculate the expected value, variance, and standard deviation of the total income

  Determine the impact of social media use on student learning

Research paper examines determine the impact of social media use on student learning.

  Unemployment survey

Find a statistics study on Unemployment and explain the five-step process of the study.

  Statistical studies

Locate the original poll, summarize the poling procedure (background on how information was gathered), the sample surveyed.

  Evaluate the expected value of the total number of sales

Evaluate the expected value of the total number of sales

  Statistic project

Identify sample, population, sampling frame (if applicable), and response rate (if applicable). Describe sampling technique (if applicable) or experimental design

  Simple data analysis and comparison

Write a report on simple data analysis and comparison.

  Analyze the processed data in statistical survey

Analyze the processed data in Statistical survey.

  What is the probability

Find the probability of given case.

  Frequency distribution

Accepting Manipulation or Manipulating

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