首页 > 其他分享 >STATS 2DA3 R questions

STATS 2DA3 R questions

时间:2024-09-18 20:01:46浏览次数:11  
标签:code STATS drive dataset 2DA3 Length questions should

STATS 2DA3 Fall 2024

ASSIGNMENT 1

1. (10 MARKSUsing the iris dataset which is available in R, answer the following questions:

(a) Use one or two lines of R code to display how many rows and columns are in the dataset. (i.e. do not just output all observations in the dataset. Write some code that will output the required information).

(b) Which variables are categorical and which are continuous?

(c)  Graph  1:  Using the ggplot function,  make a scatterplot of “Sepal.Length” against “Petal.Length” (putting “Sepal.Length” on the x-axis).

• Make the data points blue.

• Label the x-axis Sepal Length.

• Label the y-axis Petal Length.

• Label the graph Iris Data.

(d)  Graph 2: Use ggplot to make a bar chart (geom bar) displaying “Species” .  “fill” using “Species” (i.e. each species of ris should be a different colour on the graph).

(e)  Display graphs 1 and 2 in one image 代 写STATS 2DA3 R questions using R code (i.e.  do not just screen grab the 2 images and combine them).

2. (3 MARKS) Consider the plot below; it displays information on Vehicle Type and on theassociated drive train. There are 3 different types of drive train : 4 = four wheel drive, f = front wheel drive, r = rear wheel drive.

(a) Which Vehicle Type has the least observations associated with it in the dataset? (b) For “suv” vehicles, what is the majority drive train type?

(c) For “compact” vehicles, which of the 3 drive train types occurs least often?

 

3. (7 MARKS)

For the Arthritis dataset in the vcd package  [there  are 3 different levels of improvement (None, Some or Marked) that a patient can experience after receiving 1 of 2 medical treat- ments (Placebo or Treated)], perform the following tasks:

(a)  Create a Double Decker plot, displaying “Improved” as a function of “Treatment” and “Sex” . (“Treatment” should be on the lowest x-axis.)  Colour the “Improved” variable so that each level is a different colour.

(b) For female patients in the Treated group, what was the most reported level of improve- ment?

(c) For male patients in the Treated group, what was the least reported level of improve- ment?

(d) Using ggplot make a bar chart (geom bar) displaying “Treatment” .  Colour (“fill”) the “Treatment” variable with respect to the “Improved” variable.

Assignment Standards

• Answer each question.  Do not just provide code.  Any graphs must be rendered and reproduced in the report.

• LATEX is strongly recommended but not strictly required.  The use of Markdown in R studio is also recommended.

•  Submit your assignment as one .pdf documentAll R code should be included and  organized  either  at  the end  of the  assignment  or  inline  (if  using  R Markdown).

• Approximately eleven-point font (times or similar) must be used with around 1.5 line spacing and margins of at least 1 inch all around.

•  Do not include a title page.  The title and your name should be printed at the top of the first page.

• Various tools, including publicly available internet tools, maybe used by the instructor to check the originality of submitted work.

•  Students are not permitted to use generative AI in this course.   In alignment with McMaster academic integrity policy, it  “shall be an offence knowingly to . . .  submit academic work for assessment that was purchased or acquired from another source” . This includes work created by generative AI tools. Also stated in the policy is the fol- lowing, “Contract Cheating is the act of “outsourcing of student work to third parties” (Lancaster & Clarke, 2016, p.  639) with or without payment.” Using Generative AI tools is a form of contract cheating.  Charges of academic dishonesty will be brought forward to the Office of Academic Integrity.

标签:code,STATS,drive,dataset,2DA3,Length,questions,should
From: https://www.cnblogs.com/WX-codinghelp/p/18419233

相关文章

  • StatStream
    packagecom.shrimpking.t3;importjava.util.Arrays;importjava.util.IntSummaryStatistics;importjava.util.List;/***CreatedbyIntelliJIDEA.**@Author:Shrimpking*@create2024/9/1116:57*/publicclassStatStream{publicstaticvoid......
  • SciTech-Mathmatics-Probability+Statistics-Sampling : Learn Stats for Python III:
    LearnStatsforPythonIII:ProbabilityandSamplingBYIVÁNPALOMARESCARRASCOSAPOSTEDONSEPTEMBER9,2024ProbabilityandSamplingAboutPartIII:ProbabilityandSamplingPartIIIdivesintoappliedprobabilitytheory,concretelybymodelingdiscrete......
  • Can Autograding of Student-Generated Questions Quality by ChatGPT Match Human Ex
    文章目录题目摘要引言相关工作方法讨论与启示结论题目ChatGPT对学生生成问题质量的自动评分能否与人类专家媲美?论文地址:https://ieeexplore.ieee.org/document/10510637摘要    学生生成问题(SGQ)策略是一种有效的教学策略,可培养学生的高阶认知和批判......
  • SciTech-Mathematics-Probability+Statistics-Descriptive stats + percentiles in nu
    DescriptiveStats+percentilesinnumpyandscipy.statshttps://dev.to/sayemmh/descriptive-stats-percentiles-in-numpy-and-scipystats-59a7DEVCommunitySayemHoque,PostedonOct13,2022•UpdatedonNov16,2022Descriptivestats+percentilesinnumpy......
  • Docker top和stats区别
    dockertop需要指定容器,且不是动态显示容器资源使用情况dockerstats动态打印所有容器资源使用情况[root@localhost~]#dockertop--helpUsage:dockertopCONTAINER[psOPTIONS]DisplaytherunningprocessesofacontainerAliases:dockercontainertop,do......
  • Dictate Your Coding Questions
    DictateYourCodingQuestionsCodeRushUltimate24.1introducesvoicesupportforinteractingwiththeGitHubCopilotChatAItool,savingtimewhenyouneedassistance.CodeRushUltimateisaVisualStudioextensiondesignedtoimprovedeveloperp......
  • Zgo - stats.go
     packagemainimport("fmt""math""os""slices""strconv")funcmain(){args:=os.Argsiflen(args)==1{fmt.Println("Needoneormorearguments!")......
  • you will hear two long conversations. At the end of each conversation, you will
    Directions:inthissection,youwillheartwolongconversations.Attheendofeachconversation,youwillhearfourquestions.Boththeconversationandthequestionswillbespokenonlyonce.Afteryouhearaquestion,youmustchoosethebestanswer......
  • CF875F Royal Questions
    传送门\(a[i]\)和\(b[i]\)之间连一条\(w[i]\)的边,相当于把公主当作限制条件。考虑选当前这条边是否合法:1.若选了当前这条边后变成了一棵树,那即为\(x\)个点和\(x-1\)个边,可以任意舍去一个点(因为可以有王子不结婚),所以一定合法。2.若选了当前这条边后,变成了一棵基环树,即......
  • How-To-Ask-Questions-The-Smart-Way
    文章转载至github如侵立删https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way提问的智慧HowToAskQuestionsTheSmartWayCopyright©2001,2006,2014EricS.Raymond,RickMoen本指南英文版版权为EricS.Raymond,RickMoen所有。原文网址:http://......