categorical_tests_in_linear_regression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

categorical_tests_in_linear_regression [2022/10/15 18:48] – created hkimscilcategorical_tests_in_linear_regression [2022/10/15 19:35] (current) hkimscil
Line 1: Line 1:
-{{:pasted:20221015-184813.png}}+{{:pasted:20221015-193534.png}} 
 +<code> 
 +m <- mean(mtcars$mpg) 
 +m <- round(m,3) 
 +leg.m <- paste("grand mean: ", m) 
 +k <- tapply(mtcars$mpg, mtcars$am, mean) 
 +k <- round(k,3) 
 +leg.1 <- paste("auto,0: ", k[1]) 
 +leg.2 <- paste("manual,1: ", k[2]) 
 + 
 +plot(x=(mtcars$am), mtcars$mpg) 
 +abline(h=mean(mtcars$mpg), lwd=3, col='red'
 +abline(h=k[1], lwd=3, col='green'
 +abline(h=k[2], lwd=3, col='blue'
 +text(x = .2, y = 18, leg.1) 
 +text(x = .8, y = 25, leg.2) 
 +text(x = .5, y = 21, leg.m) 
 +</code> 
 + 
 + 
categorical_tests_in_linear_regression.1665827295.txt.gz · Last modified: 2022/10/15 18:48 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki