Quantcast
Channel: Active questions tagged lm - Stack Overflow
Viewing all articles
Browse latest Browse all 124

Modify the name of factor variables in lm function(summary function) in r

$
0
0

Sample code:

require(datasets); data(InsectSprays)model1 <- lm(count ~ spray, data = InsectSprays) summary(model1)

When I run above code, the result is enter image description here

However, the levels of spray is not 1,2,3,4,5, they are

enter image description here

I wonder how to display spray1/2/3/4/5 as sprayB/C/D/E/F? I saw other people can get the one showing what I want(display the true levels) with the same code see here:enter image description here


Viewing all articles
Browse latest Browse all 124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>