logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Bidit SadhukhanStatistics
(/5)

884 Answers

Hire Me
expert
Andrea LiguoriLaw
(5/5)

745 Answers

Hire Me
expert
Alexx WardEconomics
(5/5)

993 Answers

Hire Me
expert
Lakshay GabaEnglish
(5/5)

837 Answers

Hire Me
R Programming
(5/5)

In this Homework exercises, we want to define some variables as categorical variables once and for all, at the beginning

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

# In this Homework exercises, we want to define some variables as categorical variables once and for all, at the beginning

# instead of having to define them as "factor" variables everytime we do a plot

# For that, we will install tidyverse and load it as a library, in addition to loading ggplot2 as a library

install.packages("tidyverse") library(ggplot2) library(tidyverse)

 

 

## [1] UPLOAD DATA

# These data corresponds to three samples of participants, playing short sequences of finger movements. # Variables (columns)

# subject - number of participant (from 1 to 94): Careful, R will consider this variable as a continuous variable, you may want to transform it to a categorical variable depending on your needs, using factor(subject)

# group - 0, 1, 2, denotes whether participants belong to a group of #healthy older adults (0)

#Parkinson's disease patients (1) #healthy young adults(2)

# trial - trial number, typically from 1 to 180

# duration - time that participants spent completing the sequence, in milliseconds # RT - reaction time, time to first press, in RT

 

load data here...

 

# If your data vaiable is called, e.g. data, then

# define variables subject and group as factors in advance

data <- mutate(data,subject=factor(subject),group=factor(group))

 

## [2] Histogram by group

# Create a histogram of variable duration, and map the colour of # inside the histogram bars to group

# Represent it, call it p2

 

## [3]

# Try to write the aesthetic mapping within ggplot and within geom_histogram # What is the difference?

 

## [4]

# Set the colour of the border of the histogram bars to a fixed colour (choose e.g. "green" "blue" or a HEX value)

# and add a transparency level e.g. 0.6, call this p4

 

## [5] Read the help function of scale_fill_manual

# These functions allow you to specify your own set of mappings from # levels in the data to aesthetic values.

# Add to the previous plot (p4) a new layer to manually map colour to each group using scale_fill_manual: one colour per group

## [6] Save it as a pdf graphic ## [7] Scatter plot by group

# Do a scatter plot of duration against trial and map the color aesthetic to factor group, call this p7

 

## [8] Scatter plot by group: Add later of smoothed conditional means

# Add a layer to p7 and plot the mean and standard error across all data points separately for each group # Use geom_smooth()

 

## [9]

# Can you distinguish well the data points and the smoothed conditional means in each group?

# If not, try and use the aesthetics mapping from colour to group only *within geom_smooth* and not within ggplot or geom_point

# Redo exercise [8] changing the color mapping this way # How would you do it?

 

## [10]

#Redo exercise [8] but add a transparency level 0.3 to geom_point()

 

## [11] Density plot by group

# Create a density plot of this dataset, mapping the colour to factor group

 

## [12] Which group is slower in duration?

# Looking at the centre of each density plot, rank the groups from slower to faster in duration (ms) # Do not rank them only by 0/1/2 but rather, by their group name: Parkinson's, young, old, etc

 

 

## [13] Boxplot

# Do a boxplot of variable duration, and map colour to variable group

 

## [14] Orientation

#What happens with the orientation of your Boxplot?

#How would you change the orientation to display the boxplots in a most suitable way?

 

## [15] Scatter plot of duration and reaction time

# Do a scatter plot of y=duration and x=RT and map color to group # What do you observe?

 

## [16] Save it as a pdf graphic

 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme