Solved Use Rstudio. This is the information from labdata3

Use Rstudio.

This is the information from labdata3 shown in R.

ID,major,job_offers,age,extra,leader,role,intern,research,prm_2yr,years,salary,rating
1,IST,1,22,2,10,Treasurer,1,24,No,5,91799,Meets Expectations
2,IST,7,26,3,15,Secretary,4,25,Yes,6,103922,Exceeds Expectations
3,IST,8,21,1,6,Member at Large,1,6,No,4,86984,Meets Expectations
4,IST,5,26,0,0,Member at Large,1,0,No,2,63095,Below Expectations
5,IST,4,22,1,6,Secretary,2,42,Yes,3,73405,Meets Expectations
6,IST,4,23,1,6,Secretary,2,12,No,3,74926,Below Expectations
7,IST,4,30,1,6,Treasurer,3,35,Yes,4,82661,Meets Expectations
8,IST,9,23,2,12,Treasurer,4,38,Yes,5,95945,Exceeds Expectations
9,IST,15,21,5,25,Vice President,1,16,No,7,117350,Meets Expectations
10,SRA,7,29,2,12,Member at Large,2,16,No,4,89808,Meets Expectations
11,SRA,12,27,5,30,Vice President,2,19,Yes,7,115837,Meets Expectations
12,SRA,8,23,1,6,Vice President,4,3,Yes,4,85864,Meets Expectations
13,SRA,3,26,1,6,Member at Large,2,12,Yes,4,84844,Meets Expectations
14,SRA,12,28,4,24,Vice President,4,45,Yes,7,111411,Meets Expectations
15,SRA,1,21,5,30,Vice President,2,47,No,7,116061,Meets Expectations
16,SRA,7,26,3,18,Treasurer,2,22,Yes,6,101367,Meets Expectations
17,SRA,16,26,0,0,Member at Large,4,17,Yes,5,65493,Meets Expectations
18,SRA,2,24,4,24,Secretary,3,34,Yes,6,104613,Exceeds Expectations
19,Cyber,1,27,1,6,Member at Large,1,34,No,4,84821,Meets Expectations
20,Cyber,3,29,1,6,Vice President,3,5,No,3,77076,Below Expectations
21,Cyber,7,25,3,18,Secretary,1,26,No,6,103505,Meets Expectations
22,Cyber,4,29,2,12,Treasurer,3,29,Yes,5,99402,Meets Expectations
23,DS,2,25,3,17,Secretary,2,20,No,6,103500,Meets Expectations
24,DS,2,30,2,12,Treasurer,3,28,Yes,5,92652,Meets Expectations
25,DS,1,30,3,14,Treasurer,1,24,No,6,101360,Meets Expectations
26,DS,3,27,4,24,Vice President,2,40,Yes,7,111082,Meets Expectations
27,DS,4,28,4,24,Secretary,3,15,No,6,109179,Meets Expectations
28,DS,6,30,1,8,Member at Large,2,8,No,3,79345,Meets Expectations
29,DS,3,21,0,0,Member at Large,3,5,Yes,9,68539,Below Expectations
30,IST,7,24,5,30,President,3,33,No,8,128054,Meets Expectations
31,IST,3,22,5,30,President,2,32,No,8,121024,Meets Expectations
32,IST,4,24,5,30,President,3,22,No,9,136632,Meets Expectations
33,IST,2,24,4,24,Secretary,1,31,Yes,6,105816,Exceeds Expectations
34,IST,4,22,5,30,President,4,40,Yes,9,133101,Exceeds Expectations
35,IST,9,20,1,6,Member at Large,4,39,No,3,77317,Below Expectations
36,SRA,2,22,0,0,Member at Large,1,0,No,2,67231,Below Expectations
37,SRA,9,21,5,36,President,3,47,Yes,9,137142,Exceeds Expectations
38,SRA,7,20,2,12,Treasurer,1,37,No,5,99695,Meets Expectations
39,SRA,9,24,0,0,Member at Large,4,39,Yes,2,69356,Meets Expectations
40,SRA,2,25,0,0,Member at Large,2,7,No,4,64403,Below Expectations
41,SRA,5,24,1,6,Member at Large,1,38,No,3,75790,Below Expectations
42,SRA,2,24,5,27,Vice President,3,5,Yes,7,112960,Meets Expectations
43,SRA,1,25,2,12,President,3,47,Yes,4,88951,Meets Expectations
44,SRA,8,20,5,20,President,4,8,Yes,8,124214,Exceeds Expectations
45,Cyber,8,22,4,20,Secretary,1,19,No,6,105369,Meets Expectations
46,Cyber,4,23,4,24,Secretary,2,19,Yes,6,109027,Meets Expectations
47,Cyber,10,25,2,12,Treasurer,2,6,Yes,5,93170,Meets Expectations
48,Cyber,10,24,0,0,Member at Large,4,36,Yes,2,62869,Meets Expectations
49,DS,4,23,0,0,Member at Large,1,8,Yes,3,72436,Below Expectations
50,DS,4,21,5,48,President,1,5,No,9,137521,Meets Expectations

Answer and fill in the blanks following question after using Rstudio

Question 1a

Use the appropriate function to read the data into R as a data frame named lab3.data. Complete the blanks below with the missing syntax you would use to complete this import. Please assume that you’ve already set your working directory to the folder containing the file.

install.packages( Blank )

library( Blank )

Blank = Blank , ( Blank , use.value.labels=TRUE, Blank )

Question 1b

How would you rewrite your syntax to read in the file if it was tab-delimited (i.e., has a .dat extension)?

Complete the blanks below with the missing syntax you would use to complete this import. Please assume that you’ve already set your working directory to the folder containing the file.

Blank = Blank, ( Blank , header = Blank )

Question 1c

How would you rewrite your syntax to read in the file if it was comma separated (i.e., has a .csv extension)?

Complete the blanks below with the missing syntax you would use to complete this import. Please assume that you’ve already set your working directory to the folder containing the file.

Blank = Blank ( Blank , header = Blank )

Question 1d

Give an example of a command, an object, and a function in the syntax you provided above.

Question 1e

Once you’ve imported the data file you’ll see that it contains two key variables:

  • event_ID: used to label each event
  • fin_loss (in millions): the financial loss incurred by organizations from a data breach, expressed in millions

Use R to calculate a new variable (called z_scores) based on the existing variable “fin_loss”. This variable should represent the z-scores for each observation of “fin_loss”. You should therefore have a whole new column in your data set that has 500 different values. When calculating the z-scores in R, be sure to use the z-score formula from Lesson L02, a mean value of 50.08, and a standard deviation of 9.24. Complete the blanks below with the missing syntax you would use to complete this task in R.

Blank $ Blank = ( Blank $ Blank – Blank ) /

For the folowing Questions

Click your data frame in the Global Environment to view it. This will open in a separate tab in RStudio.

Click the arrows next to the variable name “z_scores” to sort the values (either in descending or ascending order) then use this information to answer the following questions.

Question 1d

What is the lowest z-score in your distribution?

Question 1f

Provide the value of financial loss that this z-score corresponds to

Question 1g

Is this z-scores significantly LOWER than you would expect based on chance? Yes or No

Question 1h

What is the highest z-score for in your distribution?

Question 1i

Provide the value of financial loss that this z-score corresponds to

Read more here: Source link