[R] Different varable lengths

Keith Jewell k.jewell at campden.co.uk
Mon Apr 30 16:55:17 CEST 2012


Missing comma between -1.180620213  and -0.525964648

"Saint" <bahman.zadeh at comhem.se> wrote in message 
news:1335779012548-4597768.post at n4.nabble.com...
> Hi!
>
> I'm trying to do a lm() test on three objects. My problem is that R 
> protests
> and says that the variable lengths differ for one of the objects
> (Sweden.GDP.gap). But I have double checked that the number of 
> observations
> are the same. All three objects should contain 9 observations but R only
> accepts 9 observations in two of the objects. The third must have 10! Very
> confusing because there is no 10th observation!
>
> # Adjusted Real rate - P
>> Sweden.p.adjust <- c(4.70243, 1.3776655, 1.117755, 1.6695175, 1.59282,
>> 1.1017625, -0.04295, 2.2552875, 0.0552875)
>>
>> # Adjusted Inflation deviation
>> Sweden.infl.dev.adjust  <- c(0.110382497, -0.261612509, 0.040847515,
>> -0.195062497, -0.234362485, -0.023408728, 0.206421261, -0.079401261,
>> 0.071828752)
>>
>> # Adjusted GDP-gap
>> Sweden.GDP.gap.adjust <- c(0.673792123, 1.196706756, 1.196131539,
>> 0.646944002, -0.312886525, -1.180620213 -0.525964648, -0.369401194,
>> -0.003280389)
>>
>> # OLS regression using ADJUSTED data.#
>> Sweden.Taylor.real.adjust <- lm(Sweden.p.adjust ~ Sweden.infl.dev.adjust 
>> +
>> Sweden.GDP.gap.adjust)
> Error in model.frame.default(formula = Sweden.p.adjust ~
> Sweden.infl.dev.adjust +  :
>  variable lengths differ (found for 'Sweden.GDP.gap.adjust')
>
> Why is this happening?
>
> / Saint
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Different-varable-lengths-tp4597768.html
> Sent from the R help mailing list archive at Nabble.com.
>



More information about the R-help mailing list