'R summary command doesn't produce summary statistics

The summary(dataframe1) command gives me summary statistics of that data frame like max, min and number of NA. Similarly, summary(dataframe1$column1) gives me summary statistics for that specific variable within the data frame (one of its columns).

That works well until I run a few regressions with lm and plm and whenever I try to get some summary statistics of a column within the data frame dataframe1 via summary(dataframe1$column1). I get as output "total sum of squares", "id" and "time".

Why does this happen? dataframe1 is not the name of my regression model but I do use dataframe1 as the data source of such regression models. How can I force the summary command to give me the summary statistics of dataframe1 again (i.e. max, min, number of NA etc)? Thank you.



Solution 1:[1]

Try with plm version 2.6-1 in which the summary printout for pseries was extended to contain the summary of the base class as well. Here is an example:

library(plm) # version 2.6-1
data("Grunfeld", package = "plm")

summary(Grunfeld$inv)
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>    0.93   33.56   57.48  145.96  138.04 1486.70

pGrunfeld <- pdata.frame(Grunfeld)
summary(pGrunfeld$inv) # pseries
#> total sum of squares: 9359944 
#>         id       time 
#> 0.76021734 0.06716957 
#> 
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>    0.93   33.56   57.48  145.96  138.04 1486.70

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Helix123