Hi all,

I hope this isn't a naive newbie question again. Here you can see column 264 of
a data frame containing data of the same interview in May and September. Column
264 contains the answers of 49 persons to a question in May.

fbhint.spss1[,264]
 [1] teils/teils  sehr wichtig <NA>         <NA>         sehr wichtig
 [6] sehr wichtig sehr wichtig sehr wichtig <NA>         <NA>
[11] <NA>         <NA>         wichtig      <NA>         <NA>
[16] sehr wichtig <NA>         <NA>         <NA>         <NA>
[21] <NA>         <NA>         <NA>         wichtig      <NA>
[26] <NA>         <NA>         <NA>         <NA>         <NA>
[31] <NA>         <NA>         <NA>         <NA>         teils/teils
[36] sehr wichtig <NA>         <NA>         <NA>         <NA>
[41] wichtig      <NA>         sehr wichtig <NA>         <NA>
[46] sehr wichtig wichtig      <NA>         <NA>
Levels: sehr wichtig wichtig teils/teils unwichtig ganz unwichtig

Column 566 contains the answers from the same persons to the same question in
September.

fbhint.spss1[,566]
 [1] <NA>         <NA>         <NA>         wichtig      wichtig
 [6] sehr wichtig sehr wichtig wichtig      wichtig      <NA>
[11] <NA>         <NA>         sehr wichtig sehr wichtig sehr wichtig
[16] sehr wichtig <NA>         unwichtig    wichtig      wichtig
[21] <NA>         <NA>         teils/teils  teils/teils  <NA>
[26] unwichtig    <NA>         <NA>         <NA>         <NA>
[31] wichtig      sehr wichtig sehr wichtig <NA>         unwichtig
[36] sehr wichtig <NA>         <NA>         teils/teils  wichtig
[41] wichtig      wichtig      <NA>         <NA>         wichtig
[46] <NA>         sehr wichtig teils/teils  <NA>
Levels: sehr wichtig wichtig teils/teils unwichtig ganz unwichtig

The following works:

median(fbhint.spss1[,264], na.rm=T)
[1] sehr wichtig
Levels: sehr wichtig wichtig teils/teils unwichtig ganz unwichtig

... but here it doesn't:

median(fbhint.spss1[,566], na.rm=T)
Error in Summary.factor(..., na.rm = na.rm) :
        "sum" not meaningful for factors

I don't have any ideas why! Can somebody give me a hint?

TIA

Best regards,

Christoph

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to