Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decimal places in Summary(model) output in R

Tags:

r

I am trying to get more than 2 decimal places from model summary output when I use nnet package. I read other threads regarding this and none of those solutions seem to work for me. I tried:

options(digits=10)
summary(model)

 b->h1 i1->h1 i2->h1 i3->h1 i4->h1 i5->h1 
  0.94  -2.67   0.83  -1.06  -2.51  -0.69 
 b->o1 h1->o1 
  1.14  -3.41 
 b->o2 h1->o2 
 -0.62   3.92 

I also tried:

summary(model,digits=10)

 b->h1 i1->h1 i2->h1 i3->h1 i4->h1 i5->h1 
  0.94  -2.67   0.83  -1.06  -2.51  -0.69 
 b->o1 h1->o1 
  1.14  -3.41 
 b->o2 h1->o2 
 -0.62   3.92 

None of those solutions work for me. I have to use caputure.output after summary output If i output the entire model or use coefnames I can get more than 2 decimal places but that is not going to help me if I use caputre.output.

like image 818
user16789 Avatar asked Apr 09 '13 13:04

user16789


2 Answers

It's likely that the print method for the object returned by summary is where the two decimal places are coming from. As a first attempt, try

print(summary(model),digits=10)   ## or whatever other number of digits

If that doesn't work, try the kind of investigation that was done in this answer:

How to make decimal digits of chisq.test four numbers ?

like image 197
Glen_b Avatar answered Sep 30 '22 14:09

Glen_b


Just use

summary(model)$wts

This will give you the weights with maximum decimal points.

If you want to have other values, e.g. residuals or so, see the manual, I attach a screenshot of the relevant part:

descrm

Just write summary(model) then $ and then e.g. wts to get the weights or e.g. residuals to get the residuals

like image 21
Stat Tistician Avatar answered Sep 30 '22 14:09

Stat Tistician