Skip to content
tombeesley  /   PSYC121_2021-22  /  
Clear Command Palette
Tip: Type # to search pull requests
Type ? for help and tips
Tip: Type # to search issues
Type ? for help and tips
Tip: Type # to search discussions
Type ? for help and tips
Tip: Type ! to search projects
Type ? for help and tips
Tip: Type @ to search teams
Type ? for help and tips
Tip: Type @ to search people and organizations
Type ? for help and tips
Tip: Type > to activate command mode
Type ? for help and tips
Tip: Go to your accessibility settings to change your keyboard shortcuts
Type ? for help and tips
Tip: Type author:@me to search your content
Type ? for help and tips
Tip: Type is:pr to filter to pull requests
Type ? for help and tips
Tip: Type is:issue to filter to issues
Type ? for help and tips
Tip: Type is:project to filter to projects
Type ? for help and tips
Tip: Type is:open to filter to open content
Type ? for help and tips
We’ve encountered an error and some results aren't available at this time. Type a new search or try again later.
No results matched your search
Search for issues and pull requests # Search for issues, pull requests, discussions, and projects # Search for organizations, repositories, and users @ Search for projects ! Search for files / Activate command mode > Search your issues, pull requests, and discussions # author:@me Search your issues, pull requests, and discussions # author:@me Filter to pull requests # is:pr Filter to issues # is:issue Filter to discussions # is:discussion Filter to projects # is:project Filter to open issues, pull requests, and discussions # is:open
  • Unwatch 1

    Notifications

    Get push notifications on iOS or Android.
Open in github.dev Open in a new github.dev tab
Permalink
ff15dfed06
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
45 lines (34 sloc) 1.59 KB
Open in github.dev
.
library(tidyverse) # load the tidyverse functions
# Week_6_Task_2
# this is a command to read in the data -
# note that this is (pretty much) the same as using the "Import Dataset" button
data_w6 <- read_csv("data_phone.csv") # read in the data
# Note here that a line of code can be split across multiple lines
# It's good practice to break the lines in logical places (e.g., after a pipe)
# draw a graph Q1-7
data_w6 %>%
ggplot() +
geom_point(aes(y = screen_time_actual, x = screen_time_estimate), colour = "red") # this is the line of code you eventually need to edit
# draw a graph Q8
data_w6 %>%
ggplot() +
geom_point(aes(y = screen_time_actual,
x = screen_time_estimate,
colour = phone_type)) # answer to Q8
# draw a graph Q9
data_w6 %>%
ggplot() +
geom_jitter(aes(y = screen_time_actual,
x = screen_time_estimate,
colour = phone_type)) # answer to Q8
# Week_6_Task_3 - Do people underestimate or overestimate their phone time use?
# create a new column (mutate) to reflect the difference
data_phone_diff <- # note: assigning the output to a new object (data_phone_diff)
data_w6 %>%
mutate(est_diff = screen_time_actual - screen_time_estimate)
# remove the 0s and count how many positives and negatives
data_phone_diff %>%
filter(est_diff != 0) %>% # remove the 0s
count(est_diff > 0) # count how many positive and negatives
# conduct a binomial test to see whether people underestimated or overestimated phone usage
binom.test(61,99) # they can also use (38, 99) to get the same result (probabilities are symmetrical)