Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

*]:pointer-events-auto scroll-mt-[calc(var(–header-height)+min(200px,max(70px,20svh)))]” tabindex=”-1″ dir=”auto” data-turn-id=”1efd220b-ec94-4291-9b3b-481f653f21f0″ data-testid=”conversation-turn-4″

*]:pointer-events-auto scroll-mt-[calc(var(–header-height)+min(200px,max(70px,20svh)))]” tabindex=”-1″ dir=”auto” data-turn-id=”1efd220b-ec94-4291-9b3b-481f653f21f0″ data-testid=”conversation-turn-4″ data-scroll-anchor=”true” data-turn=”assistant”>Question 1

Running the following code inside a Colab cell will generate a vector x with numerous random values:

set.seed(17679) n <- sample(1e+5 : 1e+7, size = 1) x <- runif(n, 0, 1e+7)

Without displaying the contents of the vector, write some code that shows how many values/elements it contains.

Question 2

From the previous question, use R code to determine what the first and last value/element of the vector x is.

Question 3

Do some internet sleuthing and state what runif() does, what sample() does, and what 1e+5 and 1e+7 mean numerically in decimal form.

Question 4

Use R code to create a dataframe that contains information about your top 10 favourite songs.The dataframe should have three columns:

Artist — the name of the artist/band

Song — the name of the song

Album — the name of the album the song appeared on

Display the dataframe you create.

Question 5

Seligman, Nolen-Hecksema, Thornton, and Thornton (1990) conducted a study with members of a university swim team.Using a questionnaire, they classified participants as optimists or pessimists. Each swimmer first completed their best event, but the researchers falsified their recorded time to make it appear worse than it actually was, thereby inducing disappointment.

Thirty minutes later, swimmers repeated the same event. The researchers predicted that pessimists would perform worse on the second trial, whereas optimists would improve.

The dependent variable was calculated as the ratio of the two times:

time1time2time2​time1​​

Thus, a value greater than 1.0 indicates faster times on the second trial.

The times are as follows:

Optimists:

0.986, 1.108, 1.08, 0.952, 0.998, 1.017, 1.08, 1.026, 1.045, 0.996, 0.923, 1, 1.003, 0.934, 1.009, 1.065, 1.053, 1.108, 0.985, 1.001, 0.924, 0.968, 1.048, 1.027, 1.004, 0.936, 1.04

Pessimists:

0.983, 0.947, 0.932, 1.078, 0.914, 0.955, 0.962, 0.944, 0.941, 0.831, 0.936, 0.995, 0.872, 0.997, 0.983, 1.105, 1.116, 0.997, 0.96, 1.045, 1.095, 0.944, 1.039, 0.927, 0.988, 1.015, 1.045, 0.864, 0.982, 0.915, 1.047

Without using the function mean(), calculate the mean for each group (optimists and pessimists).Based on the means, does it look as if the researchers were correct?

Question 6

Is the study described in the previous question an experiment? Why or why not?

Question 7

Describe what happens to the mean for the optimist and pessimist data respectively if each value has 5 added to it.Show some R code to support your statement.

Question 8

Describe what happens to the mean for the optimist and pessimist data respectively if each value is multiplied by 2.Show some R code to support your statement.

Question 9

Sixty-five participants were asked how much sleep they believe they get on average.Fourteen people answered that they generally sleep about six hours;nineteen about seven hours;twelve get around four hours;nine get about three hours;and eleven get about eight hours.

Calculate the mean.

Question 10

The following dataframe contains the total number of deaths worldwide as a result of earthquakes from 2000 to 2012:

year   deaths 2000     231 2001   21357 2002   11685 2003   33819 2004  228802 2005   88003 2006    6605 2007     712 2008   88011 2009    1790 2010  320120 2011   21953 2012     768

a. Recreate the dataframe using R.b. What percentage of deaths occurred before 2001?c. What percentage of deaths occurred from 2003 to 2010 inclusive?

Question 11

a. Create a plot using the dataframe from Question 10.b. Re-create the plot again, but this time transform the x-axis data using a base-5 logarithm.c. Re-create the plot again, but this time transform the y-axis data using a base-5 logarithm.d. Re-create the plot one more time and transform both axes’ data with a base-5 logarithm.

Question 12

There are two problems in the code below that cause it to produce errors when run.Both problems are subtle — treat this like a “Where’s Waldo” puzzle and look very carefully.

set.seed(20462) values <- round(runif(20, -10, 10)) threshold <- 0 filtered <- values[values > threshold] N       <- length(filtered) sum     <- sum(filtered) minimum <- min(filtered) mean    <- mean(filtered) med     <- median(filtered) sd      <- sd(filtered) IQR     <- IQR(filtered) vals    <- paste(filtered, collapse = “, “) filtered_stats <- data.frame(  N, sum, minimum, mean, med sd, IQR, vals ) filtered_stats

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Survey Project Group Name Group 1 Instructions Watch the following video and follow the given guidelines for creating PowerPoint Presentation: Death by PowerPoint PowerPoint Presentation Overview: T

Survey Project Group Name Group 1 Instructions Watch the following video and follow the given guidelines for creating PowerPoint Presentation: Death by PowerPoint PowerPoint Presentation Overview: Title Slide  – 1 slide Generic TitleAttitude Survey Project – Semester/ Year Group #List of Members Specific Title related to hypothesis Overview of Hypothesis – 1

Survey Project Group Name Group 1 Instructions Watch the following video and follow the given guidelines for creating PowerPoint Presentation: Death by PowerPoint PowerPoint Presentation Overview: T S

Survey Project Group Name Group 1 Instructions Watch the following video and follow the given guidelines for creating PowerPoint Presentation: Death by PowerPoint PowerPoint Presentation Overview: T Survey Project Group Name Group 1 Instructions Watch the following video and follow the given guidelines for creating PowerPoint Presentation: Death by PowerPoint PowerPoint

Thinking Instructions Please write a reflection to this week’s chapter readings must be a full college level paragraph length (200-250 words, roughly 7 complete sentences) to be accepted. Generate a l

Thinking Instructions Please write a reflection to this week’s chapter readings must be a full college level paragraph length (200-250 words, roughly 7 complete sentences) to be accepted. Generate a l Thinking Instructions Please write a reflection to this week’s chapter readings must be a full college level paragraph length

In your career, you will likely encounter an idea or problem that you could investigate using probability and statistics. In this summative assessment, you will read a research article that includes c

In your career, you will likely encounter an idea or problem that you could investigate using probability and statistics. In this summative assessment, you will read a research article that includes concepts related to probability in the context of statistical distribution and sampling. You will then create a debrief memo

In your career, you will likely encounter an idea or problem that you could investigate using analysis of variance (ANOVA). In this summative assessment, you will read a research article that includes

In your career, you will likely encounter an idea or problem that you could investigate using analysis of variance (ANOVA). In this summative assessment, you will read a research article that includes In your career, you will likely encounter an idea or problem that you could investigate using analysis of

In your career, you will likely encounter an idea or problem that you could investigate using analysis of variance (ANOVA). In this summative assessment, you will read a research article that includes

In your career, you will likely encounter an idea or problem that you could investigate using analysis of variance (ANOVA). In this summative assessment, you will read a research article that includes concepts related to the use, analysis, and graphical representation of tests comparing more than two quantitative variables, including

Assignment Instructions In your career, you will likely encounter an idea or problem that you could investigate using a chi-squared test. In this summative assessment, you will read a research article

Assignment Instructions In your career, you will likely encounter an idea or problem that you could investigate using a chi-squared test. In this summative assessment, you will read a research article that includes concepts related to basic statistics such as the use and analysis of tests comparing more than two

USING SAS on demand for academics. Analyze NHANES data to data from an Arizona study. 3-to-1 matching of NHANES participants who had PFAS measurements to firefighters can be conducted. Participating f

USING SAS on demand for academics. Analyze NHANES data to data from an Arizona study. 3-to-1 matching of NHANES participants who had PFAS measurements to firefighters can be conducted. Participating firefighters will be randomly shuffled. In shuffled order, each firefighter can be matched to the NHANES participant with the same

Assignment Overview By successfully completing this assignment, you demonstrate your proficiency in the following competency and specialized behaviors: Competency 4: Engage in practice-informed resear

Assignment Overview By successfully completing this assignment, you demonstrate your proficiency in the following competency and specialized behaviors: Competency 4: Engage in practice-informed research and research-informed practice. C4.SP.A: Apply leadership skills, ethical use of technology and research findings to inform and improve practice, policy, and programs in the specialization of advanced generalist practice settings.

Before you submit Final Project Step 1, make sure you ve read Final Project Instructions and downloaded the data you’ll need for the final project (an Excel Spreadsheet). To complete this assignment s

Before you submit Final Project Step 1, make sure you ve read Final Project Instructions and downloaded the data you’ll need for the final project (an Excel Spreadsheet). To complete this assignment successfully, follow the steps listed below: (Step 1): Download the data set: Final Project Data. (Step 2): In

8-1 Discussion: Reflection In this course, you learned core applications of statistical analysis to solve real-world personal or professional inquiry problems. You also learned different techniques to

8-1 Discussion: ReflectionIn this course, you learned core applications of statistical analysis to solve real-world personal or professional inquiry problems. You also learned different techniques to draw conclusions from data. These experiences allowed you to practice designing an approach to a statistical problem, considering assumptions and constraints, and developing interpretations