Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204922

Predict a factor of 3 levels and return the % of each factor

$
0
0

I am trying to predict a three-level factor with a set of variables. The group is A, B and C.

m<-glm(as.factor(Group)~Sex+BloodType+Pressure,data=Hel,family = "binomial")

newdata <- data.frame(Sex="M",BloodType="A+", Pressure=80)

predict(m,newdata)

and this returns:

        1 
0.7133324 

I would like that to give me back:

A        B        C
20.00   40.00    40.000

How can I do this? Thanks.


Viewing all articles
Browse latest Browse all 204922

Trending Articles



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