# STAC32

# Applications of Statistical Methods

## Ken Butler

Welcome to the home page for STAC32. This is the place to look for all things course-related (notes, assignments, announcements etc., linked above) except for assignment hand-ins and marks, which will be on Quercus.

This is an applied course. Expect to be describing the process by which you got your answers, and explaining what the answers mean *in the context of the data you are working with*: that is to say, using your language skills as well as your statistical skills. Be prepared to show your understanding and insight; this course is about a lot more than “getting the answer”.

In real life, people do Statistics to make decisions or inform actions, and you will be expected to play your full part in that process, both in this course and in your statistical future.

## News (most recent at the top):

2024-02-03 14:00: Happy new year, all! It appears that the course grades are up on ROSI (as of this morning).

A reminder that course grades are final, and that I am not allowed to discuss or negotiate them.

I plan to share your graded final exam with you shortly; this is

*for your information only*, and I will not discuss the marking of the final exam. You will receive an email from Crowdmark with instructions for accessing it. My solutions. If you think there is an error in the calculation of your grade or the marking of your final exam, you*must*go through the Registrar’s office and their procedures.If you did not pass the course, it is because you did not come close to passing the final exam and in most cases did not even get close to 40% (I checked), and thus you did not come close to displaying the level of knowledge or understanding that I expect in this course. (The final exam was written in such a way that a student aiming for 50 had every opportunity to display that they had that much knowledge). If you are in that position, you had your opportunity; you will need to take the course again next fall. There are no other ways to complete the program.

If you are tempted to email me about your grade: don’t. Re-read the above, and the note below about what course grades are based on.

To those that made it through: congratulations, and I look forward to seeing you again in D29 next week.

2023-12-26 16:30: Hope you are enjoying whatever it may be that you are celebrating (which might be some well-deserved rest), and I wish you a happy new year. Our final exam is graded, and I am about to submit the course grades that you earned. Before I do that, though, some things I need to say:

- To calculate your course grade:
- I turn each assignment mark into a percentage, find the top 6 of those, and take the mean of them.
- I turn the midterm and final exam marks into percentages (out of 57 and 99 respectively).
- I calculate course grades by two schemes: the one announced in the syllabus, and counting the final exam in place of the midterm (for everyone, whether you wrote the midterm or not). You automatically get whichever scheme gives you the higher course grade.
- If you get less than 40% on the final exam but would otherwise have passed, your course grade is 45.
- 0.5 and above is rounded up; below that is rounded down.

- Course grades need to be be submitted and approved before they reach you. I don’t know how much human intervention that requires, but it may be that you don’t get your course grades until the university re-opens in January.
- Some of the work done on the final exam was very good, and there will be several A+ grades.
- We were, for the most part, generous in marking the final exam.
- I have reviewed grades close to key grade boundaries and am happy that I have things in the right places.
- If you are under investigation for an academic offence in this course, your grade is GWR until the investigation is concluded.
- Course grades are based
*only*on the work you have done and the understanding you have displayed. Your personal circumstances do not, and cannot, figure into your grade. It does not matter how hard you worked, or that you need a certain grade for a scholarship or to graduate. If you want those things, it is up to*you*to do work of sufficient quality to earn them. - If you don’t like your grade, you have exactly two options: a clerical check and, after obtaining a copy of your marked exam, a petition for re-reading of your final exam. If you file this petition, I have the right to re-grade your entire exam, and I may find places where the grading has been too generous.
- There is no extra credit. See detailed course policies, item 5.3.
- Contacting me about your grade is
*not*one of your options, and to do so is a waste of your time. Doing so may also contravene the Code of Behaviour on Academic Matters; for example, if you ask for a grade you did not earn, you are asking me to commit an offence under B.I.3(a) on your behalf. - It is no longer possible to appeal any course work, such as assignments or the midterm.

- To calculate your course grade:
2023-12-21 21:15: we are now 82% done. What remains is mostly question 4 and some odd other things. I think I am done marking.

2023-12-20 21:50: today’s progress report: 69% done as I write. Question 1 is done, 2 is done apart from (g), 3 is underway, half of 5 is done, question 6 is done (by me, today), and 7 is about half done. My solutions as amended today.

2023-12-19 23:00: progress report: 42% done. This includes almost all of question 1, almost all of question 2, and most of the other odd bits that I gave myself to grade. I have to tackle question 6 tomorrow, along with one bit of question 7 that I forgot.

2023-12-18 22:30: we have a scanned exam, and grading has begun. We are 18% done: part of questions 1 and 2, and my two parts of question 7. (I wanted to get warmed up with something easier to grade.) I am about done for tonight, and will get back to it tomorrow. My solutions, with the Figures at the end.

2023-12-18 14:05: Our final exam, like the midterm, is a Crowdmark exam, so it needs to be scanned first, and then we can grade it (online). There were several exams on Saturday that will need to be scanned, so we will have to wait our turn. After that, the grading can start. Expect to see occasional updates here on our progress.

2023-12-14 14:10: a reminder that our final exam is on Saturday morning at 9:00am. See the Quercus announcement for where to be.

2023-12-13 23:30: tonight I discovered that Quarto websites can have things called “listings pages” (actually, while trying to figure out why those data files with STAC32 in their URLs were not showing up). As a result, we now have all the worksheets and all the assignment solutions in one place. This is much easier for you, and also for me to keep updated.

2023-12-08 16:45:

- The final exam has gone for printing. I decided to keep all the questions I had, and I think it actually adds up to exactly 100 points (I didn’t add anything).
- The final exam is more than 50% longer than the (very short) midterm, so if you were running short of time on the midterm, be aware that you will need to be more organized for the final. (On the midterm, as far as I could tell, most people seemed to have plenty of time.)
- As a guide, you have about 4 minutes per part and a bit less than 2 minutes per point. (Some of the parts and points will be a lot quicker than that if you are well prepared.)
- I have been tinkering with the website, to make my organization of it better. You will notice that it looks a little different. I think everything is where it should be, but if you notice anything missing, let me know.
- I will have office hours on Wednesday next week. I’m aiming to be around 11:00am to 1:00pm, so that you can still catch me if you have either a morning or an afternoon exam that day.

2023-11-27 16:55: I think I am happy with the general shape of the final exam. It now has 7 questions with a total of 41 parts worth a total of 99 points. I still need to do some serious editing; I am not going to make it any longer, but it might end up being a little shorter than it is now.

2023-11-27 11:30: into the last week of classes:

- I just posted an announcement on Quercus with the date, time, and location of our final exam. This is on Quercus only for security reasons (to be only accessible to people in this course).
- Assignment 7 is mostly graded and Assignment 8 is partly graded. I will release the grades when I have confirmation that the grading is done. My solutions to Assignment 8.
- Worksheet 12 for this week’s tutorial. This is rather long, to give you lots of opportunity for practice.
- Lectures this week (yes, we are not done yet):
- Tuesday: finish the multiple regression material, including regression with categorical variables.
- Thursday: functions, as far as we get through that.

- PASIAS problems on functions.

2023-11-22 21:15: There is a Worksheet 12 ready for next week, which I will share on Monday. I have also been working on our final exam, which currently has 5 questions with a total of 28 parts worth a total of 67 points. I plan to add two more questions, so that the total points is somewhere near 90. Be aware that this will be more than 50% longer than the midterm — you will need to make sure to have your materials organized so that you can work efficiently.

2023-11-20 14:15: this is week 11 (of 12, the last lecture being on Nov 30).

- Assignment 7 is being graded. My solutions. Assignment 8 is due tonight, and will be the final one. (The best 6 out of your assignment scores, by percentage, will count towards your course grade.)
- Lectures this week:
- Tuesday: finish the windmill case study and start on the asphalt one (multiple regression)
- Thursday: finish the asphalt case study and start on regression with categorical variables.
- The rest of the way: I want to finish the regression stuff and talk about functions. I have some stuff about dates and times that I will probably leave until D29.

- Worksheet 11 on simple and multiple regression, for tutorial on Wednesday. This is rather long, and includes more material on multiple regression than we will likely get to in the Tuesday lecture, but it seemed to fit together well, and it gives you a chance to practice everything. You may prefer to leave some of it until after Thursday’s lecture.
- PASIAS problems for multiple regression, to practice after we get to that.

2023-11-13 15:15: A slightly late Monday update, because I realized I got out of sync with where I expected to be, and the worksheet 10 and assignment 8 I had planned were no longer suitable. Anyway, that is now fixed, and the story is this:

- Assignment 6 has been graded. My solutions. Appeals by usual procedure between Nov 16 and Nov 23.
- Assignment 7 is due tonight; the final Assignment 8 opens on Wed night.
- lectures this week:
- Tuesday: the rest of tidying data
- Thursday: simple regression (one \(x\)-variable; the windmill case study)

- Worksheet 10 for tutorial on Wed. This is rather long, but I wanted to give you some practice on various aspects of tidying data. (Assignment 8 is actually rather short.)
- PASIAS problems on simple regression, for later in the week.

2023-11-11 20:00: How to get good with R, a blog post by Nick Tierney (who

*is*good with R).2023-11-07 12:30: Assignment 4 is also graded. My solutions. Appeals by usual procedure between Nov 10 and Nov 17 inclusive.

2023-11-06 13:55: Monday update:

- Assignment 5 is graded. My solutions. Appeals by usual procedure between Nov 9 and Nov 16 inclusive.
- the longer Assignment 4 is about 2/3 graded. I will post the grades for that when it is finished.
- Assignment 6 due tonight; Assignment 7 opens on Wed night.
- in lecture this week: tidying data. There are about three pieces of lecture notes on this: tidying data, extras, when pivot-wider goes wrong. I intend to finish the first of those tomorrow.
- you may have noticed that there is a lecture on writing reports. I am skipping that this time.
- Worksheet 9 for tutorial on Wednesday.
- Extra examples in PASIAS:
- analysis of variance, chapter 13
- tidying data, chapter 17, with several examples of real-life data tidying (particularly problems 7, 8, 9 in that chapter).

2023-10-30 12:00: Monday update:

- Assignment 5 is due tonight, as usual.
- this week’s lectures: the rest of Mood’s Median test (Tuesday), and analysis of variance (Thursday, but we might start this on Tuesday). Some of the analysis of variance stuff will look familiar (from B27 or your second course), but some of it will be new to you.
- Worksheet 8 for tutorial this week, on matched pairs and Mood’s median test. Assignment 6, on those same two things, opens on Wed night.
- I keep forgetting to point you towards extra practice problems in PASIAS: matched pairs in chapter 11, Mood’s median test in chapter 10, normal quantile plots in chapter 12, and analysis of variance in chapter 13. (The chapters are slightly out of order at this point, corresponding with how I did things in the past.)
- Looking ahead: the assignments will go up to #8, due on November 20. (As things stand now, this will be on the second part of tidying data and the first part of regression.) I want to give you a bit of a break at the end of the course, but be aware that the rest of the material after that (multiple regression, functions, dates and times)
*will be on the final exam*and so there will be worksheets 11 and 12 to enable you to practice those. (We have one lecture after the final tutorial, so the last worksheet might stretch to the content in that last lecture.)

2023-10-26 14:20: re final exam: the dates and times of the final exams are now public, but the rooms are not. I am told that we will soon have access to a tool that will tell us which room to go to. To keep the campus safe, don’t tell people outside our class which room our final is in (once you find out).

2023-10-26 13:35: further to our discussion in class today about P-values: I talked about Fisher (who we learned about in connection with 0.05) and Neyman and Pearson. I didn’t have it quite right, according to this, which is a 1993 paper from the Journal of the American Statistical Association by a veteran statistician who worked in hypothesis testing. My TL;DR of the paper, along with some of my own opinions, is this:

- Fisher was very argumentative, especially about the rightness of his views and the wrongness of everybody else’s, and the two schools of hypothesis testing had more in common than it may have seemed at the time.
- If you look in the back of the textbook for your first statistics course, you’ll see that there are tables of complete probabilities for the (standard) normal distribution, but only some probabilities for the t-distribution (and the chi-squared distribution). The “only some” probabilities was started by Fisher. This was apparently
*not*because he was of the decision-making school, even though we saw the quote earlier in lecture about how he made that comment about 5%; he was more of the strength-of-evidence school and organized statistical tables while expecting you to say “the P-value is between 0.01 and 0.05” or whatever. - Fisher only considered the null hypothesis and the probability of type I error.
- Jerzy Neyman (Polish) and Egon Pearson (English) were more firmly of the decision-making school (do you reject the null? Yes or no?), but they also believed that you should have your alternative hypothesis in mind, and devised tests that gave you the most power while keeping the type I error probability under control. Sometimes this gives the same test as Fisher would have used, and sometimes not.
- Egon Pearson’s father, Karl Pearson, was also a statistician, and invented the chi-squared test that we saw in lecture today.
- Some things, like Pearson Sr.’s chi-squared test and the Welch t-test, don’t really come from a theory of “this is the best test”, but rather from “here is something we can do that looks sensible”. If you have done the chi-squared test by hand, that business of observed minus expected squared, divided by expected, was Pearson’s “sensible idea”; the actual best test is slightly different but usually gives similar results. Welch was looking for a way of getting P-values for his two-sample t-test out of standard t-tables, and did it by approximating the degrees of freedom in a way that worked and had some theoretical basis (but may not be the absolute best).
- The theory we have today is sort of a mish-mash of Fisher and Neyman-and-Pearson, and different people use it in different ways. Some people think of the P-value as a decision-making tool, and some as the strength of evidence (and some people, Bayesian statisticians mostly, think that we should be doing something entirely different).

2023-10-26 13:30: my solutions to assignment 4.

2023-10-23 23:20: a rather late Monday update before I head for bed:

- Assignment 4 due in about 35 minutes.
- this week’s lectures, a bit indefinite. My recollection is that the first two of these go pretty fast, but we’ll see.
- Tuesday: normal quantile plots and maybe some of matched pairs
- Thursday: the rest of matched pairs and start Mood’s median test.

- Worksheet 7 for tutorial on Wed
- Assignment 5 will open on Wed and be due next week Monday as usual.

2023-10-19 11:45: My solutions to Assignment 3. I am about to release the marks; appeals by the usual procedure between Oct 22 and Oct 29 inclusive.

2023-10-16 11:45: back to work, and back to Monday updates:

- don’t forget that Assignment 3 is due tonight, the one you’ve had about three weeks to work on.
- this week’s lectures will be:
- Tuesday: finish off power, start sign test
- Thursday: finish sign test, start normal quantile plot

- worksheet 6 on power and sign test, for Wednesday tutorial.
- Assignment 4 on the same material as worksheet 6 will open on Wednesday night and be due on Monday 23rd at 11:59pm.
- we had an extra Worksheet before the midterm, so the rest of the way, Worksheet \(n\) goes with Assignment \(n-2\).

2023-10-11 10:45: I am about to release the midterm marks and send you your marked exam:

- mark (out of 57) will be on Quercus. (I think I said 67 before; it’s actually 57.)
- to see your marked exam, look in your email: you will have an email from Crowdmark with instructions to access your marked exam.
- read over your marked exam with my solutions.
- appeals: same procedure as for assignments. See note on 2023-09-21 11:00. You need to demonstrate an
*error*in the marking of your exam, relative to my solutions. I will not overrule a grader’s judgement for part marks; thus, the only things worth appealing are (a) actual errors like addition errors (very unlikely here) or (b) when the grader appears to have missed part of your work and you should get full marks. If (b) is the case, you should make the case that*your*work is a complete answer: that is to say, that it says all the same things that my solutions do. Appeals window: between Oct 14 and Oct 21 inclusive. - if your midterm mark disappoints you, it is up to you to sort out how you can study more effectively for the final. Some tips:
- attend
*every*lecture and take notes. I say more in lecture than is on the slides, so you need to note things down so that you do not forget them. - if you must miss class (eg. you are sick), it is still your responsibility to catch up on the material you miss, eg. by watching the old lecture videos. You should watch these with the
*current*slides and note any differences (the material in the slides is what you need to learn). - go to every tutorial, do every worksheet, and ask questions of the TA if you get stuck. Finish the worksheet on your own time if you don’t finish in tutorial.
- for extra practice, read and work through the appropriate chapters of PASIAS
- do your assignments yourself using your lecture notes. They are designed to be mostly straightforward if you have done the corresponding worksheet. Getting outside assistance on the assignments may confuse you more than it helps you.

- attend

2023-10-10 17:30: the midterms are graded. I don’t have time to share the grades or marked exams yet (later tonight or tomorrow morning), but the stats are: Q1 40/57 (71%), median 45.5/57 (80%), Q3 50/57 (88%). These are partly a reflection of some excellent work, and partly a reflection of this being a short and relatively straightforward exam. While I won’t be making the final exam extra-difficult, be aware that you may

*find*it longer and tougher, because there is more stuff that might be on it that you’ll need to know about. (This is a more or less inevitable consequence of having an early midterm; if we had had a late midterm, you would probably have had a harder time on the midterm and an easier time on the final.)2023-10-10 14:00: reading week non-Monday update:

- the midterm is, as I write, 96% graded (just one question to go)
- reminder: no lectures or tutorials this week
- Assignment 3 is due on Mon Oct 16 (and there will be assignments due weekly from then on)
- when the midterm is graded: I will post the marks on Quercus, explain the appeal process (it will be like the process for the assignments), and you will get your marked exams back via an email from Crowdmark (which will tell you what you need to do).

2023-10-07 21:00: because I am a professor, I have been spending my Saturday night marking your midterms (as opposed to, say, hanging out at the pub with a beer). I am now done my share, and the marking in total is 87% done, with just question 2 left. I have been adding to my solutions with extra comments related to the questions I have been marking. Here are my solutions.

2023-10-06 18:00: the midterm is 47% marked (though my suspicion is that it’s the easiest 47%). The long Question 3 is done, along with 1(a) and (c) and part of (b).

2023-10-05 10:45: midterm was last night:

- Expect grading to happen over the next week or so. If you missed the midterm (for whatever reason), the 30% of your grade that was on it is automatically transferred to the final exam. (You don’t need to ask; it will happen automatically.)
- This was one of the shortest midterms I have given (as well as one of the earliest; these things go together). This made the midterm easier for you, but it also makes the final harder, because there is more stuff that could be on the final that you will need to be prepared for.
- If it so happens that you do better on the final exam than the midterm, I will count your final exam instead of the midterm. (I think that is unlikely this semester, but if it happens for you, you can take advantage of it.)

2023-10-02 19:30: Assignment 2 is graded, and I am about to post the marks. Appeals by the same procedure as assignment 1, between Oct 5 and Oct 12 inclusive.

2023-10-02 14:00 (edited 14:30):

- I forgot that the week of October 9-13 is reading week (no lectures or tutorials), so Assignment 3 is now due the week
*after*that (Oct 16). Looking ahead, Assignment 4 will go with worksheets 5 and 6, so I will try not to make it too long. - On the schedule for this week:
- Tuesday lecture: bootstrap sampling distribution of sample mean (which will give a better answer to a question from last week). I will have office hours afterwards from 2-4 in IC 471.
- Wednesday: tutorial
*and*midterm. If you’re in the 4-5 tutorial, make sure to allow yourself enough time to get to the exam room. Expect that the TAs in that tutorial will end it early so that you and they can get to the exam on time. Feel free to use tutorial time to ask questions about exam material, including the stuff that is on worksheet 5. - The midterm has 5 questions with 22 parts altogether, worth a total of 67 points.
- Thursday lecture: power analysis, which will probably continue after reading week.

- I forgot that the week of October 9-13 is reading week (no lectures or tutorials), so Assignment 3 is now due the week
2023-09-29 12:00: My solutions to assignment 2.

2023-09-28 14:20: as promised, Assignment 3 is open but is now not due until Oct

*9*, so that you are not worrying about doing that at the same time as preparing for the midterm. (Having said that, working on Assignment 3 may be helpful in your preparations.) If you want more examples of the latest material, look in PASIAS: Chapter 6 for the one-sample stuff, and Chapter 7 for the two-sample material we looked at today.2023-09-28 13:45: midterm is confirmed: Wed Oct 4, 5:00-7:00pm in HW 216.

2023-09-28 11:30: I am sharing the next worksheet with you early so that you can practice the stuff in today’s lecture.

2023-09-26 12:30: what to expect for the midterm (whenever it is)

- open book: you can bring any printed or handwritten material you wish (no computers)
- make sure you organize what you bring so that you can find what you need during the exam
- exam will include writing code (by hand, sorry) and interpreting output
- you will receive an exam paper with spaces to write your answers (that you hand in)
- you will also receive a booklet of numbered figures to refer to while writing the exam
- the exam style will be similar to old midterms and, indeed, to the assignments you have seen so far
- if there is an assignment due close to the midterm date, I will reschedule the assignment.

2023-09-25 18:00: a rather late Monday update:

- breaking news: it is possible that our midterm may be as early as
*October 4*. I will let you know as soon as possible when we have a confirmed date, time, and place, and if it is then or later. - Assignment 2 is due tonight at 11:59pm.
- in lectures this week:
- Tuesday: finish off one-sample inference
- Thursday: two-sample inference.

- this week’s tutorial features worksheet 4. The second question there is on one-sample inference.
- now that I have you thinking about the midterm:
- the course website has a selection of past midterms (under Old Exams). Some years, the midterm is later or earlier than others, and so there will be more or less material included in the midterm (and you will see some things in old midterms (perhaps many things) that
*we*haven’t covered yet). - the coverage for our midterm, whenever it is, will be up to the end of the last lecture but one before the midterm. (Examples: if the midterm is on a Wednesday, that means up to the previous Thursday, and if it is on a Friday, that means up to the previous Tuesday.)
- if you want more examples of anything, look at PASIAS. These are old homework problems, with answers, for example:
- chapter 2 on reading in data
- chapter 3 on drawing graphs
- chapter 4 on numerical summaries
- chapter 5 on choosing rows and columns
- chapter 6 on one-sample inference
- chapter 7 on two-sample inference

- Assignment 3 is currently scheduled to be due on October 2. That will be rescheduled if it turns out to be close to the midterm.

- the course website has a selection of past midterms (under Old Exams). Some years, the midterm is later or earlier than others, and so there will be more or less material included in the midterm (and you will see some things in old midterms (perhaps many things) that

- breaking news: it is possible that our midterm may be as early as
2023-09-21 11:00: Assignment 1 has been graded, and I am about to post the marks. My solutions. Read through your work with my solutions and the grader’s comments to learn what you can do better next time. If you wish to appeal your assignment mark, read all of the following:

- wait before appealing anything.
- write me an email with the word “appeal” and the assignment number in the subject line,
*between September 25 and October 2 inclusive*, in which you explain how there was*an error*in the grading of your assignment: that is to say, the grader missed something you wrote that was completely correct according to my solutions or that you argue also was a complete answer to the question. This also includes such things as addition errors in your assignment mark. - the grader’s judgement (on part marks for a question part, for example) is not open to appeal. The reason for this is that the grader makes a number of judgement calls when grading an assignment. Sometimes their call is more rigorous than you would like, and sometimes it is generous. These will even out over the course of the semester. The purpose of grade appeals is to correct errors, where you can make a convincing case that you deserve full marks on part of a question.
- for more detail, see detailed course policies, items 3.18 through 3.22.

2023-09-19 11:45: Worksheet 3 for tutorial tomorrow (added now because I am likely to forget otherwise).

2023-09-18 09:00: Here’s the plan for this week:

- Monday at 11:59pm: Assignment 1 is due. It remains open until Wed at the same time, but there is a late penalty (1% per
*hour*). - Tuesday lecture: finish numerical summaries, choosing things from dataframes
- Wednesday tutorial: worksheet on numerical summaries and choosing things from dataframes. Assignment 2 on the same things opens, and is due next Monday.
- Thursday lecture: finish choosing things from dataframes, start one-sample t-tests.
- At the end of the week, we will be beginning a longish collection of work on statistical inference, many of the ideas in which you have seen before. I have two goals with that work:
- to show you how it works with R
- to make sure that you know what you are doing (especially when it comes to setting up and interpreting hypothesis tests), because typically people don’t seem to learn that very well the first time around. I also try to provide some context for how the various inferential methods fit together and where you would use each (and some graphs you can use to help you decide).

- Monday at 11:59pm: Assignment 1 is due. It remains open until Wed at the same time, but there is a late penalty (1% per
2023-09-15 13:50: if you were (until yesterday) on the waitlist for this course, you need to know that the course is full and the only way you will be able to get into the course now is if someone drops the course and you are quick enough to grab their spot. If you need this course to graduate, it was

*your*responsibility to register for it as soon as possible after your registration opened. See the notes on July 24. It is not possible for you to be added to the course; if you ask me, the answer is no.2023-09-14 15:10: that lost phone is now with Lost and Found (SW 304). If it is yours, claim it from there.

2023-09-14 09:45: for assignment 1, if you are running R on your own computer

*and*that computer is running Windows, then the code I gave you with`download.file`

in it should look like this:

`download.file(my_url, "walking.xls", mode = "wb")`

where `my_url`

is the URL I gave you (that ends in `.xls`

). If you are using `r.datatools`

, or if your computer is a Mac (or runs Linux), then you should be OK with the code I gave you in the assignment. (The assignment question file is now updated.) Thanks to the student who spotted this quicker than I did!

2023-09-12 23:55: just remembered that I need to post worksheet 2 for tutorial.

2023-09-12 15:00: Somebody dropped their phone on the way out of lecture today. I have the phone. Come collect it from me in my office (IC 471). I’m here for another 30 mins or so today and likely sometime tomorrow.

2023-09-12 10:45: It was raining heavily when I arrived on campus, but I am here (if rather wet). As I write, Accuweather says that there will be another shower finishing around 11:30, then another around 14:00 when our class finishes.

2023-09-11 12:15: On the agenda for this week:

- Making graphs (Tuesday)
- Numerical summaries (Thursday)
- The start of “Choosing things in dataframes” (maybe Thursday)
- There will be a Worksheet 2 for tutorial on Wednesday, on reading data from files and making graphs.
- Assignment 1, on those same two things, will open on Wednesday night and be due the following Monday at 11:59pm.
- You can expect, at least until we get to the midterm, that Assignment \(n\) will be on the same material as Worksheet \(n+1\), and both of those will be based on the material in the Thursday and Tuesday lectures before you tackle Worksheet \(n+1\).

2023-09-11 11:30 edit 2023-09-12 12:00: I have just taken a look through the Assignment 0 that you handed in:

- If you got 1 (out of 1), I could see your data and your graph, and it looked like the right thing.
- If you got 0 and you handed something in, there was something I couldn’t read, and you will have an Assignment Comment telling you what happened and what you need to do to fix it. Feel free to try again; you have unlimited submissions on this “Assignment”, and it’s still open.
- It doesn’t count towards your course grade (ignore any late penalty), therefore the point of Assignment 0 is to get it right, so that you will also get the handing in of the other assignments right.
- Edit to add: I have looked through the ones that were handed since I looked yesterday, and most people have got it right now (I added a comment one way or the other). In my experience, the people that have trouble handing in assignments (real ones) later are people who didn’t hand in Assignment 0. This is a free chance to get the procedure right before it counts for anything.

2023-09-07 11:20: some files for today’s lecture:

- the first spreadsheet
- the CSV version of that
- the coffee cup data
- the second spreadsheet
- the migraine data

2023-09-06 11:00: this is our first time using Quarto documents in this course, and there are (inevitably) some teething troubles. Some of you in the 9am tutorial discovered that your graphs were disappearing after you rendered a document and downloaded it to hand in. The solution is this: up at the very top of your document, you’ll see a line like this:

`format: html`

*Remove* that line and replace it with these lines:

```
format:
html:
embed-resources: true
df-print: paged
```

(the indentation on the lines after the first is important: it should be two spaces on the `html`

line and four spaces on the lines below that).

These lines should be at the top of any document where you plan to take the html output and move it somewhere else (eg. hand it in on Quercus, or download it and look at it).

If you are wondering why that is: things like graphs on your output are actually stored as image files, in the same folder as your Quarto document is (which might be on `r.datatools`

). When you look at the html file there, the images are in the same folder and show up, but when you move the html file somewhere else, the images don’t go with it and are thus *not* available when you look at the html on your machine or on Quercus. (The same applies if you are running R on your computer: as soon as you hand the html file in on Quercus, because you have moved the file from one place to another, the images are gone.) The fix above makes the html file “self-contained”, in that it contains everything it needs to display properly, wherever you move it to. The bottom line, the `df-print`

one, is actually nothing to do with this; all it does is to make dataframes display nicely in your output, but since it fits here and is nice to know about, I’m suggesting that you add it too.

This is actually exactly the same problem as I had with the original version of worksheet 1 that some of you downloaded yesterday and saw was missing images (my screenshots). I applied the same fix as above to my file, not realizing (yesterday) that you were going to run into the same thing today. You are welcome to have another go at editing your “Assignment 0” Quarto document as above, re-rendering it and handing it in again. This time you should find that the graphs and any other images did indeed make it to the thing you handed in. (You can hand in Assignment 0 as many times as you like.)

2023-09-05 14:25 edited 15:15: I messed up some connections to things:

- worksheet 1 (now fixed)
- the lecture slides page, which seems to be linking to last year’s (now fixed)
- the lecture videos page, which you don’t have permission to access yet, so I need to move it somewhere where you do (I think I have done now.) I think I have fixed everything now. Let me know of any lingering problems (if needed, reload any such pages and see if that fixes things).

2023-09-05 11:40: Here is Worksheet 1 that you’ll be working through in tutorial tomorrow.

2023-09-01 20:30: We get underway on Tuesday next week, September 5. The agenda for the week is:

- Tuesday: brief look at the syllabus, introduction to R and R Studio
- Wednesday: tutorial (yes, we have tutorials in week 1) where you will be working through a worksheet with a TA there for help if you get stuck. I do this so you can hit the ground running, and practice what we have seen in lecture as soon as possible.
- Thursday: reading data from files, and making graphs (or, some of the latter, anyway). Expect to see a worksheet on this week’s material in the week 2 tutorial, and an Assignment 1 on that same material coming out after your week 2 tutorial.

2023-07-24 16:15: I have added a few students from the waitlist. These are the fourth years who joined the waitlist before July 19, and the third years who joined the waitlist before 08:15:30 on July 11. There is not likely to be room to add further students, and so if you if you are still on the waitlist after that, you will have to take your chances. There is a large demand for this course, so it is important to register for it as soon as your registration window opens.

2023-07-24 15:45: there were seven people enrolled in the course or on the waitlist without a prerequisite course (STAB27 or equivalent). These students have been removed from the course.

2023-07-24 15:00: time to open up the website for this year, now that the course is open for enrolment:

- I’m aware that there is already a waitlist. I plan to look more carefully at who is on the waitlist, with the aim of making sure that those who really need the course are able to take it. My priority order is: students in the Statistics Applied Minor program, and within those, students in the fourth year of study (or beyond) as calculated by UTSC, then students in earlier years of study in the program, and then students in other programs. Appealing directly to me is a waste of your time.
- I will be checking prerequisites. To take STAC32, you
*must*have completed (by the time STAC32 starts in September) either STAB27 or PSYC08 or MGEB12. If you have not completed one of these courses by then, you will be removed from STAC32. - Looking ahead to next winter’s STAD29: my aim is to make sure that there will be enough space in that course for everyone that wants to take it (and has completed STAC32).
- Program FAQ.