Bug 17336 - print.summary.lm prints NaN t stats as NA
Summary: print.summary.lm prints NaN t stats as NA
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: R-devel (trunk)
Hardware: Other Other
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-09-10 09:18 UTC by k_bugzilla
Modified: 2017-09-10 09:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description k_bugzilla 2017-09-10 09:18:30 UTC
(Picking up an example from https://hypatia.math.ethz.ch/pipermail/r-help/2017-September/448985.html)

summary.print.lm (or rather some printing function used inside) prints a NaN t statistic as NA (as is true for the p-value).

Here is an example:

x <- c(1,2,3)
y <- c(1,1,1)

a <- lm (y ~ x)
print(summary(a))

# Coefficients:
#            Estimate Std. Error t value Pr(>|t|)    
# ...
# x                  0          0      NA       NA    

while:
summary(a)$coefficients
#             Estimate Std. Error t value Pr(>|t|)
# ...
# x                  0          0     NaN      NaN

As 0/0 is NaN in R, the NA in the printed output can be confusing.