STA518-01-SS21 / community

Discussions related to course content will be held here.
1 stars 6 forks source link

Activity 3.1: Why do we need to round for problem 12? #16

Closed katiewebster closed 3 years ago

katiewebster commented 3 years ago

I'm having somewhat of a problem with problem 12 of the .rmd file. I'm wondering why we need to round to the nearest whole number when it seems the numbers are already like that? And also, I can set all instances of 39 to 20 but then I can't figure out how to assign that to top_secret without running the part of the code twice. It seems you can't do two <- in one line. (This has been moved to its own issue: #17)

dykesb commented 3 years ago

When going through all of the calculations (especially with exponentiating, square rooting, squaring) there might be some estimation/additional digits being brought along. For example, suppose that you have a data set like the following where the values represent percent:

Fresh Soph Jun Sen Total
37 25 20 18 100

You want to verify that columns Fresh through Sen actually add up to the total so you might do something like Total - sum(Fresh, Soph, Jun, Sen) (note that this won't work in R). However, you might get a result of 0.00000001. Rounding after the calculations helps to verify values that we expect to get.