Plotting and linear models
To run your code, click run. It will let you know if your code is correct or not, and will offer hints on what to fix if needed. If you are stuck, you can see the solution by clicking Solution.
Exercise 1: Calculate a Linear model
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOTgxLDE5ODEsMTk4MSwxOTgyLDE5ODIsMTk4MiwxOTgyLDE5ODMsMTk4MywxOTgzLDE5ODMsMTk4NCwxOTg0LDE5ODQsMTk4NCwxOTg1LDE5ODUsMTk4NSwxOTg1LDE5ODYsMTk4NiwxOTg2LDE5ODYsMTk4NywxOTg3LDE5ODcsMTk4NywxOTg4LDE5ODgsMTk4OCwxOTg4LDE5ODksMTk4OSwxOTg5LDE5ODksMTk5MCwxOTkwLDE5OTAsMTk5MCwxOTkxLDE5OTEsMTk5MSwxOTkxLDE5OTIsMTk5MiwxOTkyLDE5OTIsMTk5MywxOTkzLDE5OTMsMTk5MywxOTk0LDE5OTQsMTk5NCwxOTk0LDE5OTUsMTk5NSwxOTk1LDE5OTUsMTk5NiwxOTk2LDE5OTYsMTk5NiwxOTk3LDE5OTcsMTk5NywxOTk3LDE5OTgsMTk5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nRzXG4jICAgICAtIHRlc3RfZXhwcmVzc2lvbl9lcnJvcigpIC0tIGNhbiBjaGVjayBpZiBmdW5jdGlvbnMgYXJlIHByb3Blcmx5IGRlZmluZWRcbiMgICAgIC0gdGVzdF9vcGVyYXRvcignb3BlcmF0b3InLCksIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfZnVuY3Rpb25fZGVmaW5pdGlvbigpIC0tIHJpZ29yb3VzbHkgY2hlY2sgZGVmaW5lZCBmdW5jdGlvblxuIyAgICAgLSB0ZXN0X2RhdGFfZnJhbWUoKSAtLSBjaGVjayBpZiBkYXRhZnJhbWUgW2NvbHVtbnNdIGFyZSBlcXVpdmFsZW50XG4jICAgICAtIHRlc3RfZnVuY3Rpb25fcmVzdWx0LCB0ZXN0X2V4cHJlc3Npb25fcmVzdWx0In0=
Exercise 2: Using ggplot()
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOT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50XG4jICAgICAtIHRlc3RfZnVuY3Rpb25fcmVzdWx0LCB0ZXN0X2V4cHJlc3Npb25fcmVzdWx0In0=
Exercise 3: A better linear model
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
Reminder: interactions in a linear model can be done fully using * or partially using :.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOTgxLDE5ODEsMTk4MSwxOTgyLDE5ODIsMTk4MiwxOTgyLDE5ODMsMTk4MywxOTgzLDE5ODMsMTk4NCwxOTg0LDE5ODQsMTk4NCwxOTg1LDE5ODUsMTk4NSwxOTg1LDE5ODYsMTk4NiwxOTg2LDE5ODYsMTk4NywxOTg3LDE5ODcsMTk4NywxOTg4LDE5ODgsMTk4OCwxOTg4LDE5ODksMTk4OSwxOTg5LDE5ODksMTk5MCwxOTkwLDE5OTAsMTk5MCwxOTkxLDE5OTEsMTk5MSwxOTkxLDE5OTIsMTk5MiwxOTkyLDE5OTIsMTk5MywxOTkzLDE5OTMsMTk5MywxOTk0LDE5OTQsMTk5NCwxOTk0L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IgdGVzdCBiIHBhc3NcbiMgICAgIC0gdGVzdF9nZ3Bsb3QoKSAtLSBjYW4gY2hlY2sgaWYgcGxvdHMgYXJlIGNvcnJlY3RcbiMgICAgIC0gdGVzdF9mdW5jdGlvbigpIC0tIGNhbiBhbHNvIGNoZWNrIGluY2x1ZGVkIHBhcmFtZXRlcnNcbiMgICAgIC0gdGVzdF9sb29wKCkgLS0gY2hlY2tpbmcgZm9yIGFuZCB3aGlsZSBsb29wc1xuIyAgICAgLSB0ZXN0X2xpYnJhcnlfZnVuY3Rpb24oJ3BhY2thZ2UnLCBub3RfY2FsbGVkX21zZz0nJyxpbmNvcnJlY3RfbXNnPScnKVxuIyAgICAgLSB0ZXN0X2lmX2Vsc2UoKSAtLSBjaGVja2luZyBpZiBzdGF0ZW1lbnRzXG4jICAgICAtIHRlc3RfZXhwcmVzc2lvbl9lcnJvcigpIC0tIGNhbiBjaGVjayBpZiBmdW5jdGlvbnMgYXJlIHByb3Blcmx5IGRlZmluZWRcbiMgICAgIC0gdGVzdF9vcGVyYXRvcignb3BlcmF0b3InLCksIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfZnVuY3Rpb25fZGVmaW5pdGlvbigpIC0tIHJpZ29yb3VzbHkgY2hlY2sgZGVmaW5lZCBmdW5jdGlvblxuIyAgICAgLSB0ZXN0X2RhdGFfZnJhbWUoKSAtLSBjaGVjayBpZiBkYXRhZnJhbWUgW2NvbHVtbnNdIGFyZSBlcXVpdmFsZW50XG4jICAgICAtIHRlc3RfZnVuY3Rpb25fcmVzdWx0LCB0ZXN0X2V4cHJlc3Npb25fcmVzdWx0In0=
Exercise 4: Plotting the better linear model
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
Notice how this code is identical to exercise 3, except with the different model name.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnko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NoZWNrIGluY2x1ZGVkIHBhcmFtZXRlcnNcbiMgICAgIC0gdGVzdF9sb29wKCkgLS0gY2hlY2tpbmcgZm9yIGFuZCB3aGlsZSBsb29wc1xuIyAgICAgLSB0ZXN0X2xpYnJhcnlfZnVuY3Rpb24oJ3BhY2thZ2UnLCBub3RfY2FsbGVkX21zZz0nJyxpbmNvcnJlY3RfbXNnPScnKVxuIyAgICAgLSB0ZXN0X2lmX2Vsc2UoKSAtLSBjaGVja2luZyBpZiBzdGF0ZW1lbnRzXG4jICAgICAtIHRlc3RfZXhwcmVzc2lvbl9lcnJvcigpIC0tIGNhbiBjaGVjayBpZiBmdW5jdGlvbnMgYXJlIHByb3Blcmx5IGRlZmluZWRcbiMgICAgIC0gdGVzdF9vcGVyYXRvcignb3BlcmF0b3InLCksIG5vdF9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfZnVuY3Rpb25fZGVmaW5pdGlvbigpIC0tIHJpZ29yb3VzbHkgY2hlY2sgZGVmaW5lZCBmdW5jdGlvblxuIyAgICAgLSB0ZXN0X2RhdGFfZnJhbWUoKSAtLSBjaGVjayBpZiBkYXRhZnJhbWUgW2NvbHVtbnNdIGFyZSBlcXVpdmFsZW50XG4jICAgICAtIHRlc3RfZnVuY3Rpb25fcmVzdWx0LCB0ZXN0X2V4cHJlc3Npb25fcmVzdWx0In0=
Exercise 5: Comparing the models with a line plot
Note: it appears that Datacamp-light can’t test plot accuracy at the time of writing this. As such, please manually check the solution once you think you know the answer, or if you get stuck.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE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