lab07

.pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

20

Subject

Statistics

Date

May 6, 2024

Type

pdf

Pages

7

Uploaded by ConstableUniverse27622 on coursehero.com

4/25/24, 12 : 00 AM lab07 Page 1 of 7 https://stat20.datahub.berkeley.edu/user/vidushidwivedi/rstudio/p/c6140e43/ Attaching package: 'dplyr' The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union cobalt (Version 4.5.4, Build Date: 2024-02-26) Create a data frame based of the data you collected, listed in the order in which it was collected, and print it out into your lab report. You can print all rows your data frame using slice(my_df, 1 : 100). Consult the notes “A Tool for Computing with Data” for a refresher of how to make a data frame. Does the data frame differ at all from the one that you sketched into your experimental protocol ? If so, how ? lab07 Vidushi Dwivedi AUTHOR library (ggplot2) library (dplyr) library (infer) library (broom) library (cobalt) Question 1 No changes were made to our experimental protocol. Question 2 vidushi <- data.frame ( trial_number = c ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 1 temperature = c ( "hot" , "cold" , "roomtemp" , "roomtemp"
4/25/24, 12 : 00 AM lab07 Page 2 of 7 https://stat20.datahub.berkeley.edu/user/vidushidwivedi/rstudio/p/c6140e43/ trial_number temperature condition ranking refreshment_ranking 1 1 hot with a straw 2 FALSE 2 2 cold with a straw 8 TRUE 3 3 roomtemp with a straw 7 TRUE 4 4 roomtemp with a straw 8 TRUE 5 5 hot with a straw 3 FALSE 6 6 hot with a straw 2 FALSE 7 7 cold with a straw 9 TRUE 8 8 roomtemp with a straw 8 TRUE 9 9 cold with a straw 10 TRUE 10 10 cold without a straw 10 TRUE 11 11 cold without a straw 9 TRUE 12 12 roomtemp without a straw 7 TRUE 13 13 roomtemp without a straw 8 FALSE 14 14 hot without a straw 2 TRUE 15 15 hot without a straw 1 FALSE 16 16 roomtemp without a straw 8 TRUE 17 17 hot without a straw 1 TRUE 18 18 cold without a straw 9 condition = c ( rep ( "with a straw" , 9 ), rep ( "without a straw" , 9 )), ranking = c ( 2 , 8 , 7 , 8 , 3 , 2 , 9 , 8 , 10 , 10 , 9 , 7 , 8 , refreshment_ranking = c ( FALSE , TRUE , TRUE , TRUE , FALS ) vidushi
4/25/24, 12 : 00 AM lab07 Page 3 of 7 https://stat20.datahub.berkeley.edu/user/vidushidwivedi/rstudio/p/c6140e43/ FALSE Warning: The statistic is based on a difference or ratio; by default, for difference-based statistics, the explanatory variable is subtracted in the order "TRUE" - "FALSE", or divided in the order "TRUE" / Question 3 ggplot (vidushi, aes ( x = ranking, fill = temperature)) + geom_bar () Question 4 library (infer) set.seed ( 333 ) obs_stat <- vidushi |> specify ( explanatory = refreshment_ranking, response = trial_number) |> calculate ( stat = "diff in means" )
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help