I am hoping for some advice regarding limiting decimal points to 3.
'Round' produces the desired results except for the 97.5% confidence
interval.
Any advice as to how I modify the code to obtain output to 3 decimal
points for all ouput is appreciated,
regards
Bob Green
mod.multgran <-multinom(offence ~ grandiose * violent.convictions,
data = kc, na.action = na.omit)
summary(mod.multgran, cor=F, Wald=T)
Anova (mod.multgran)
> round(exp(coef(mod.multgran)),digits = 3)
(Intercept) grandiosey violent.convictionsy
GBH.UW 0.583 0.147 0.806
homicide 0.333 0.343 0.882
grandiosey:violent.convictionsy
GBH.UW 0.001
homicide 0.764
> round(exp(confint(mod.multgran)),digits =3)
, , GBH.UW
2.5 % 97.5 %
(Intercept) 0.341 9.990000e-01
grandiosey 0.040 5.370000e-01
violent.convictionsy 0.297 2.187000e+00
grandiosey:violent.convictionsy 0.000 6.265942e+26
, , homicide
2.5 % 97.5 %
(Intercept) 0.173 0.641
grandiosey 0.101 1.165
violent.convictionsy 0.268 2.905
grandiosey:violent.convictionsy 0.058 10.031
Bob Green wrote:> I am hoping for some advice regarding limiting decimal points to 3. > 'Round' produces the desired results except for the 97.5% confidence interval. > Any advice as to how I modify the code to obtain output to 3 decimal > points for all ouput is appreciated, >The rounding is fine, it is just that one of the values is huge, so that exponential notation is used. If you insist, start playing around with formatC. Something like noquote(formatC(....., digits=3, format="f", width=31) ) might do it.> regards > > Bob Green > > > mod.multgran <-multinom(offence ~ grandiose * violent.convictions, > data = kc, na.action = na.omit) > summary(mod.multgran, cor=F, Wald=T) > Anova (mod.multgran) > > round(exp(coef(mod.multgran)),digits = 3) > (Intercept) grandiosey violent.convictionsy > GBH.UW 0.583 0.147 0.806 > homicide 0.333 0.343 0.882 > grandiosey:violent.convictionsy > GBH.UW 0.001 > homicide 0.764 > > round(exp(confint(mod.multgran)),digits =3) > , , GBH.UW > > 2.5 % 97.5 % > (Intercept) 0.341 9.990000e-01 > grandiosey 0.040 5.370000e-01 > violent.convictionsy 0.297 2.187000e+00 > grandiosey:violent.convictionsy 0.000 6.265942e+26 > > , , homicide > > 2.5 % 97.5 % > (Intercept) 0.173 0.641 > grandiosey 0.101 1.165 > violent.convictionsy 0.268 2.905 > grandiosey:violent.convictionsy 0.058 10.031 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Peter,
Many thanks. I have never seen a confidence interval from 0.000 to
626594160468154480000000000.000 - this is a worry.
I am also still puzzled why use of digits = 3, produced output which
includes 2, 3 and 4 decimal points as per below. The two decimal
point values for the coef should have been 2.479, 1.027, 1.614.
regards
Bob
> print(exp(coef(mod.multacute)),digits = 3)
(Intercept) in.acute.dangery violent.convictionsy
GBH.UW 0.233 3.90 0.714
homicide 0.183 2.48 0.682
in.acute.dangery:violent.convictionsy
GBH.UW 1.03
homicide 1.61
> print(exp(confint(mod.multacute)),digits =3)
, , GBH.UW
2.5 % 97.5 %
(Intercept) 0.130 0.417
in.acute.dangery 1.384 10.970
violent.convictionsy 0.213 2.390
in.acute.dangery:violent.convictionsy 0.146 7.200
, , homicide
2.5 % 97.5 %
(Intercept) 0.0964 0.349
in.acute.dangery 0.7194 8.543
violent.convictionsy 0.1747 2.660
in.acute.dangery:violent.convictionsy 0.1767 14.738