pbreheny / visreg

Visualization of regression functions
http://pbreheny.github.io/visreg/
61 stars 18 forks source link

Why `y~y` plot is there? #47

Closed vspinu closed 6 years ago

vspinu commented 6 years ago

Currently the first plot generated by visreg(fit) is the response vs response (y~y) plot which is always tilted. To my mind this plot is not particularly useful. All displays in car and effects packages don't plot y~y but stick with the actual (right side) terms. I think this plot could be dropped or, maybe, replaced with fitted ~ response plot.

pbreheny commented 6 years ago

I don't know what you're talking about. At no point is a y~y plot generated in, say, this output:

fit <- lm(Ozone ~ Solar.R + Wind + Temp, data=airquality)
visreg(fit)

Can you give me an example where you see the plot you're talking about?

vspinu commented 6 years ago

I see. It has to do with variable names. Here you go:


tt <- airquality
tt[["Ozone1"]] <- 1:nrow(tt)
fit <- lm(Ozone ~ Solar.R + scale(Wind) + Temp + Ozone1, data=tt)
visreg(fit)

Probably a regexp or match issue.

pbreheny commented 6 years ago

Ah ha, very interesting. Yes, it's a grep issue. Thanks for pointing this out!

vspinu commented 6 years ago

Thanks!