[R] Eliminate cases in a subset of a dataframe

Hollix Holger.steinmetz at web.de
Mon Sep 14 22:35:18 CEST 2009


Hi Guys,

thank you all for you comments. Actually, I had a typo and you'r right that
it should be "subdata[-c(11,22,33) , ]"

However, this does not work well either. I think, I know the reason:

In the diagnostic diagramm (that you get with plot(linreg) ), the number
which are assigned to the most salient outliers refer to the number in the
row.names-vector!? When I open the speadsheet with fix(subdata) and
note the case number associated with the row.names-value for the respective
case, I can exclude them correctly!?

For instance, the diagnostics refer to 11,22, and 33, and in the spreadsheet
the associated case numbers whould be, say, 100, 101, and 102.

Then I have to exclude these numbers with subdata[-c(100,101,102),] in order
to eliminate the three outliers (11,22,33)!. This is really weird as I do
not open the spreadsheet
any time I quickly want to exclude a few outliers.

Seems that R remembers that the row.names-values were the former case
numbers 
in the dataframe from which the subset was created....

Best,
Holger
-- 
View this message in context: http://www.nabble.com/Eliminate-cases-in-a-subset-of-a-dataframe-tp25437374p25443124.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list