Please help me in resolving the questions.
--- title: "Final Code Section" author: "STUDENT NAME" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(knitr) ``` # Instructions You will need to complete the portion of the exam before starting the second portion. You will use your answers on this exam to complete the second half. Only knitted files will be graded! Make sure your complete this portion of the exam on your own. Use your notes and class examples to get started with the code. # Abstract Much attention has been devoted to how technological advancements have created a brave new workplace, revolutionizing the ways in which work is being carried out, and how employees can improve their productivity and efficiency. However, the advent of technology has also opened up new avenues and opportunities for individuals to misbehave. This study focused on cyberloafing—the act of employees using their companies' internet access for personal purposes during work hours. Cyberloafing, thus, represents a form of production deviance. Using the theoretical frameworks offered by social exchange, organizational justice and neutralization, we examined the often-neglected dark side of the internet and the role that neutralization techniques play in facilitating this misbehavior at the workplace. Specifically, we developed a model, which suggested that when individuals perceived their organizations to be distributively, procedurally and interactionally unjust, they were likely to invoke the metaphor of the ledger as a neutralization technique to legitimize their subsequent engagement in the act of cyberloafing. *Citation:* Lim, V. K. (2002). The IT way of loafing on the job: cyberloafing, neutralizing and organizational justice. Journal of Organizational Behavior, 23, 675-694. doi: 10.1002/job.161 # Method Participants were given interviews to determine their perception of the company. After their interview the amount of cyberloafing (minutes per day) was measured using different types of computer stations. All employees were measured at each type of station. # Dataset: -Gender of the worker: male or female -Perception of company: unjust, neutral, fair -Cyberloafing: a measure of the amount of cyberloafing for several months -Workstation distance: distance of workstation from boss - Length of time: time spent working at current job In this section, the data will be loaded for you from the package. You will change the id = 123456 to your HU id number. This number will generate your data for you in the same time each way, so if you rerun this analysis, you will get the same numbers each time. ```{r starting} library(learnSTATS) final <- final_data(idnum = 123456) head(final) ``` # one-way anova - are there differences in cyberloafing based on the perception of the company? use a one-way anova to determine if there are group differences. - run the anova using the `ez` library. ```{r anova} ``` # post hoc - run a post hoc test and correction on company perception. ```{r posthoc} ``` # correlations - include a correlation table of all the continuous variables with the `hmisc` library. ```{r correl1} ``` - calculate the difference in correlations for 1) cyberloafing and distance and 2) cyberloafing and length of time. # hierarchical regression: - use a hierarchical regression predicting cyberloafing with the following steps: - step 1: gender - step 2: perception of company - step 3: length of time, workstation distance - include the `summary()` at each step. include an `anova()` on all three models to be able to examine the changes in each step. ```{r regression} ``` # mediation or moderation - using cyberloaf as the dependent variable, test either: - mediation using distance as x and length of time as m - examining if length of time working for the company mediates the relationship between workstation distance and cyberloafing. - moderation using distance as x and length of time as m - examining if length of time interacts with the workstation distance to predict cyberloafing. - just one of these! - you can use the special package for this analysis, but be sure to include all portions of the analysis (mediation: models, sobel, bootstrapping; moderation: models + simple slopes) ```{r medmod} ``` final_data(idnum="123456)" head(final)="" ```="" #="" one-way="" anova="" -="" are="" there="" differences="" in="" cyberloafing="" based="" on="" the="" perception="" of="" the="" company?="" use="" a="" one-way="" anova="" to="" determine="" if="" there="" are="" group="" differences.="" -="" run="" the="" anova="" using="" the="" `ez`="" library.="" ```{r="" anova}="" ```="" #="" post="" hoc="" -="" run="" a="" post="" hoc="" test="" and="" correction="" on="" company="" perception.="" ```{r="" posthoc}="" ```="" #="" correlations="" -="" include="" a="" correlation="" table="" of="" all="" the="" continuous="" variables="" with="" the="" `hmisc`="" library.="" ```{r="" correl1}="" ```="" -="" calculate="" the="" difference="" in="" correlations="" for="" 1)="" cyberloafing="" and="" distance="" and="" 2)="" cyberloafing="" and="" length="" of="" time.="" #="" hierarchical="" regression:="" -="" use="" a="" hierarchical="" regression="" predicting="" cyberloafing="" with="" the="" following="" steps:="" -="" step="" 1:="" gender="" -="" step="" 2:="" perception="" of="" company="" -="" step="" 3:="" length="" of="" time,="" workstation="" distance="" -="" include="" the="" `summary()`="" at="" each="" step.="" include="" an="" `anova()`="" on="" all="" three="" models="" to="" be="" able="" to="" examine="" the="" changes="" in="" each="" step.="" ```{r="" regression}="" ```="" #="" mediation="" or="" moderation="" -="" using="" cyberloaf="" as="" the="" dependent="" variable,="" test="" either:="" -="" mediation="" using="" distance="" as="" x="" and="" length="" of="" time="" as="" m="" -="" examining="" if="" length="" of="" time="" working="" for="" the="" company="" mediates="" the="" relationship="" between="" workstation="" distance="" and="" cyberloafing.="" -="" moderation="" using="" distance="" as="" x="" and="" length="" of="" time="" as="" m="" -="" examining="" if="" length="" of="" time="" interacts="" with="" the="" workstation="" distance="" to="" predict="" cyberloafing.="" -="" just="" one="" of="" these!="" -="" you="" can="" use="" the="" special="" package="" for="" this="" analysis,="" but="" be="" sure="" to="" include="" all="" portions="" of="" the="" analysis="" (mediation:="" models,="" sobel,="" bootstrapping;="" moderation:="" models="" +="" simple="" slopes)="" ```{r="" medmod}="">- final_data(idnum = 123456) head(final) ``` # one-way anova - are there differences in cyberloafing based on the perception of the company? use a one-way anova to determine if there are group differences. - run the anova using the `ez` library. ```{r anova} ``` # post hoc - run a post hoc test and correction on company perception. ```{r posthoc} ``` # correlations - include a correlation table of all the continuous variables with the `hmisc` library. ```{r correl1} ``` - calculate the difference in correlations for 1) cyberloafing and distance and 2) cyberloafing and length of time. # hierarchical regression: - use a hierarchical regression predicting cyberloafing with the following steps: - step 1: gender - step 2: perception of company - step 3: length of time, workstation distance - include the `summary()` at each step. include an `anova()` on all three models to be able to examine the changes in each step. ```{r regression} ``` # mediation or moderation - using cyberloaf as the dependent variable, test either: - mediation using distance as x and length of time as m - examining if length of time working for the company mediates the relationship between workstation distance and cyberloafing. - moderation using distance as x and length of time as m - examining if length of time interacts with the workstation distance to predict cyberloafing. - just one of these! - you can use the special package for this analysis, but be sure to include all portions of the analysis (mediation: models, sobel, bootstrapping; moderation: models + simple slopes) ```{r medmod} ```>