Timeline for Determine if linear regression is not appropriate before looking at data?
Current License: CC BY-SA 4.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 6, 2019 at 22:56 | comment | added | Glen_b | Considerable understanding of the variables and their relationships is often available even before data are collected, from a variety of sources. (e.g. on general reasoning grounds we might realize that variables bounded below - typically by zero - may often tend to be right skew and heteroskedastic, and that linear relationships will generally not be the case near a bound on the response variable, and so forth. Theory or previous studies may provide additional information) | |
Jun 6, 2019 at 7:44 | answer | added | rinspy | timeline score: 0 | |
Jun 6, 2019 at 6:02 | history | migrated | from stackoverflow.com (revisions) | ||
Jun 5, 2019 at 22:36 | vote | accept | Matthew | ||
Jun 5, 2019 at 7:01 | answer | added | Jon Spring | timeline score: 4 | |
Jun 5, 2019 at 6:20 | comment | added | Jon Spring |
You might consider using a quadratic formula for a much better fit and lower AIC, e.g. mod_quad = lm(formula = Y ~ poly(X1, 2) + poly(X2, 2), data = cakes) ; and then broom::glance(mod_quad) for a tidy look at the model summaries. That brings the adjusted r^2 from 0.36 to 0.96, and the AIC down from 49.9 to 12.6.
|
|
Jun 5, 2019 at 0:23 | comment | added | Jon Spring | It also makes sense that the quality of a cake should not increase monotonically with temperature and time. There's a "sweet spot" but if you overcook it will get worse. | |
Jun 5, 2019 at 0:05 | comment | added | neilfws | I think the answer to the question as written is "you can't". Looking at the data is the first step in every analysis. | |
Jun 4, 2019 at 23:52 | comment | added | Matthew | @Marius Right. I think the word "before looking at the data" confused me. I was trying to guess the type of regression by seeing the predictor variables or their type. | |
Jun 4, 2019 at 23:44 | comment | added | Marius | It's worth mentioning that the example in the question has an interaction between X1 and X2, which would mean a curved planed in the 3D scatterplot. | |
Jun 4, 2019 at 23:41 | comment | added | Sam Mason | Second that! The first steps should be understanding the data generating process and checking the data. These will probably involve (several) plots, and maybe writing code to do more complicated checks or transformations. There will often be iteration between these steps as data is rarely correct or in the right form for analysis. | |
Jun 4, 2019 at 23:26 | comment | added | James Phillips | In this case, I would make a 3D scatterplot of X1, X2, and Y to see if the data appears to lie on a flat plane. If visual inspection reveals that the data does not lie on a flat plane, that would indicate to me that a simple model of the form "Y = a * X1 + b * X2 + c" is not optimal. | |
Jun 4, 2019 at 22:53 | history | asked | Matthew | CC BY-SA 4.0 |