Strange Results of summary()

Hubert Palme palme@uni-wuppertal.de
Wed, 18 Mar 1998 17:05:28 +0100 (MET)


--l4Siqd0eqV
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I run the following job. Please, compare the results of summary and
table concerning berufl. From similar SPSS/PSPP runs, the result of
table is correct. 

Did I misunderstand anything or is there a bug? 

What does the difference come from?
What does '(other)' mean?
What about the strange order of the levels?

I attach the data file at the end.

Thanks in advance, HP.

> options(digits=10)
> MiniHag <- read.table("minihagR.dat",
+                       col.names=c(
+                         "befragnr",
+                         "geschl",
+                         "alter",
+                         "famstand",
+                         "schule",
+                         "beruf",
+                         "einkom",
+                         "w1",
+                         "w2",
+                         "w3",
+                         "w4",
+                         "w5",
+                         "w6",
+                         "w7"
+                         ),
+                       na.strings=c(NA,NA,"97","9","9","9","9999",
+                         "9","9","9","9","9","9","9")
+                       )
> 
> # Value Labels:
> 
> #MiniHag$geschll <- factor(MiniHag$geschl)
> #levels(MiniHag$geschll) <- c("maennlich", "weiblich")
> 
> MiniHag$geschll <- factor(MiniHag$geschl, labels=c("maennlich", "weiblich"))
> MiniHag$famstandl <- factor(MiniHag$famstand, levels=1:5,
+                             labels=c(
+                               "verheiratet, zusammenlebend",
+                               "verheiratet, getrennt lebend",
+                               "verwitwet",
+                               "geschieden",
+                               "ledig")
+                             )
> MiniHag$schulel <- factor(MiniHag$schule, levels=1:5,
+                           labels=c(
+                             "kein Abschluss",
+                             "Hauptschule",
+                             "Fachschulreife",
+                             "Fachhochschulreife",
+                             "Abitur")
+                           )
> MiniHag$berufl <- factor(MiniHag$beruf, levels=1:8,
+                          labels=c(
+                            "wissensch.-technisch",
+                            "Leiter Oeff. Dienst/Wirtschaft",
+                            "Bureaukraft",
+                            "Handel",
+                            "Dienstleistungsgewerbe/Soldat",
+                            "Gaertner/Jaeger",
+                            "Guetererzeugung",
+                            "sonstige")
+                          )
> 
> # "Descriptives":
> 
> summary(MiniHag)
     befragnr            geschl           alter            famstand     
 Min.   :  67.000   Min.   :1.0000   Min.   :18.0000   Min.   :1.0000  
 1st Qu.: 761.250   1st Qu.:1.0000   1st Qu.:33.0000   1st Qu.:1.0000  
 Median :1742.500   Median :2.0000   Median :48.0000   Median :1.0000  
 Mean   :1595.625   Mean   :1.5125   Mean   :47.4375   Mean   :2.0375  
 3rd Qu.:2409.250   3rd Qu.:2.0000   3rd Qu.:59.0000   3rd Qu.:3.0000  
 Max.   :2998.000   Max.   :2.0000   Max.   :83.0000   Max.   :5.0000  
                                                                       
      schule            beruf               einkom               w1        
 Min.   :1.00000   Min.   : 1.000000   Min.   : 350.000   Min.   :1.0000  
 1st Qu.:2.00000   1st Qu.: 3.000000   1st Qu.: 800.000   1st Qu.:6.0000  
 Median :3.00000   Median : 4.000000   Median :1500.000   Median :7.0000  
 Mean   :2.78481   Mean   : 4.621622   Mean   :1628.113   Mean   :6.0625  
 3rd Qu.:3.00000   3rd Qu.: 7.000000   3rd Qu.:2000.000   3rd Qu.:7.0000  
 Max.   :5.00000   Max.   : 8.000000   Max.   :5000.000   Max.   :7.0000  
 NA's   :1.00000   NA's   :43.000000   NA's   :  27.000                   
        w2              w3               w4               w5       
 Min.   :1.000   Min.   :1.0000   Min.   :1.0000   Min.   :1.000  
 1st Qu.:5.000   1st Qu.:5.0000   1st Qu.:4.0000   1st Qu.:3.750  
 Median :6.000   Median :6.0000   Median :6.0000   Median :4.500  
 Mean   :5.675   Mean   :5.7375   Mean   :5.4375   Mean   :4.475  
 3rd Qu.:7.000   3rd Qu.:7.0000   3rd Qu.:7.0000   3rd Qu.:6.000  
 Max.   :7.000   Max.   :7.0000   Max.   :7.0000   Max.   :7.000  
                                                                  
        w6               w7             geschll  
 Min.   :1.0000   Min.   :1.000   maennlich:39  
 1st Qu.:2.0000   1st Qu.:3.750   weiblich :41  
 Median :4.0000   Median :5.000                 
 Mean   :3.7125   Mean   :4.375                 
 3rd Qu.:5.0000   3rd Qu.:6.000                 
 Max.   :7.0000   Max.   :7.000                 
                                                
                         famstandl                schulel  
 verheiratet, zusammenlebend :54   kein Abschluss    : 1  
 verheiratet, getrennt lebend: 0   Hauptschule       :36  
 verwitwet                   :10   Fachschulreife    :29  
 geschieden                  : 1   Fachhochschulreife: 5  
 ledig                       :15   Abitur            : 8  
                                   NA's              : 1  
                                                          
                   berufl  
 Bureaukraft         :15  
 Guetererzeugung     : 9  
 sonstige            : 4  
 Handel              : 3  
 wissensch.-technisch: 3  
 (Other)             : 3  
 NA's                :43  
> 
> # "Frequencies":
> 
> attach(MiniHag)
> table(geschll)
maennlich  weiblich 
       39        41 
> table(famstandl)
 verheiratet, zusammenlebend verheiratet, getrennt lebend 
                          54                            0 
                   verwitwet                   geschieden 
                          10                            1 
                       ledig 
                          15 
> table(schulel)
    kein Abschluss        Hauptschule     Fachschulreife Fachhochschulreife 
                 1                 36                 29                  5 
            Abitur 
                 8 
> table(berufl)
          wissensch.-technisch Leiter Oeff. Dienst/Wirtschaft 
                             3                              0 
                   Bureaukraft                         Handel 
                            15                              3 
 Dienstleistungsgewerbe/Soldat                Gaertner/Jaeger 
                             2                              1 
               Guetererzeugung                       sonstige 
                             9                              4 
> detach(MiniHag)


--l4Siqd0eqV
Content-Type: application/octet-stream
Content-Description: Input Data
Content-Disposition: attachment;
	filename="minihagR.dat"
Content-Transfer-Encoding: base64

ICA2NyAxIDcxIDEgMiA5IDE1MDAgNiA0IDcgNyA1IDEgNQogIDg2IDIgMjggMSAzIDkgIDcw
MCA3IDUgNyA3IDQgMSA1CiAxMDUgMiA1OCAxIDIgOSA5OTk5IDcgNSA3IDcgNyA0IDYKIDE0
MCAyIDY5IDMgMiA5IDE2MDAgNyA1IDYgNiA2IDYgNQogMTc4IDEgNDIgMSAyIDMgMTcwMCA3
IDcgNyA1IDEgNCA1CiAxODYgMiAyOSAxIDUgOSAgNTUwIDUgNSA2IDYgNCAxIDMKIDIxOCAx
IDM0IDEgMyAzIDIxMDAgNyA0IDcgNyA1IDEgNAogMjU5IDIgNjEgMSAzIDk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NyA1IDYgNyA0IDUgNQoyNzg3IDIgNzggNSAyIDkgOTk5OSA0IDQgNiA0IDMgNSAyCjI4
MDcgMiA1OSAxIDIgOSAgNjAwIDYgNSA0IDQgNSAzIDYKMjg0NyAxIDQ4IDUgMyA3IDE3MDAg
MSAyIDMgNCAxIDEgMQoyODc3IDIgMzUgMSAyIDkgOTk5OSA3IDQgNyA1IDcgNyA1CjI5NzAg
MiA2OCAzIDIgOSAyMDAwIDYgNyA1IDEgMiA0IDMKMjk5NSAxIDI1IDUgMiA5IDk5OTkgNyA1
IDcgNiAzIDIgNQoyOTk4IDEgMzkgMSAyIDcgMTgwMCA3IDcgNyA0IDMgMSA2Cg==

--l4Siqd0eqV
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


-- 
======================================================================
Hubert Palme         Bergische Universitaet-Gesamthochschule Wuppertal
                                      Computing  Center
                                      D-42097 Wuppertal
Email: palme@uni-wuppertal.de             (Germany)
http://www.hrz.uni-wuppertal.de/hrz/personen/h_palme.html

--l4Siqd0eqV--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._