[R] plm(): observations not used for modelling

David Winsemius dwinsemius at comcast.net
Wed Nov 7 22:18:15 CET 2012


Restoring some context:

DB wrote:
> 
>> The fuction plm only uses 286 of these observations (also if the model is
>> changed to first differences and the effect to individual) and omits 23
>> observations due to na.action, but in my dataset they do not contain NAs.
>> Is this due to the Transformation used in the plm function?
>> 
>> If it is of any help, these are the observations that are omitted (which
>> obviously don't contain NAs):
>> 
>> 176 1995                                                   Spanien
>> 177 1996                                                   Spanien
>> 178 1997                                                   Spanien
>>   Verkehrstote_Quote Autobahnlaenge_Quote PKW_Quote$Value LKW$Value
>> 
>> DW> I was surprised to [see] a "$" in a variable name. Are you sure that is not the source of your problems?
>> 
>> dat <- data.frame(a$b = 1:3, d=1:3)
>> Error: unexpected '=' in "dat <- data.frame(a$b ="
>> 
>> DW> I would not expect the internal parsing routines to necessarily properly handle invalid column names.
>> 


On Nov 7, 2012, at 12:26 PM, Daniel Bab. wrote:

> Thank you for your help.
> That's an interesting point, I haven't thought about that.
> Altough I would find it strange that I get a model, where just some
> observations are missing, if the problem is due to invalid variable names.
> That's the first thing I will try to change.

I wasn't able to fully explain it either. You provided no code and the data was in a form that suggested some pathology in preparation. So I probably should have just suggested that you post all the output from :

dput(dataframe[ c( 90:110 , 370:400),  ]) 

 ... so we could see what rows looked like from both excluded and non-excluded categories.

> 
> --
> View this message in context:

We don't use Nabble. Omitting context makes your postings unintelligible for people expecting to see an email chain. Nabble makes it easy to include context (although editing is not so easy.)

> Sent from the R help mailing list archive at Nabble.com.

Rhelp is a mailing list.

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list