[R] why warnings message is there after running the plm regression

Jim Lemon jim at bitwrit.com.au
Sat Feb 15 07:28:17 CET 2014


On 02/15/2014 03:19 PM, Ramesh Chandra Das wrote:
>   beer<- read.csv("C:/Users/Administrator/Desktop/beer.csv")>
> View(beer)>  attach(beer)The following objects are masked from chem_1:
>
>      C_SALE, CFO, Company, DISEX, PPE, REV, ROA, SALE, TA, TAC, Year>
> library(plm)>  y<-cbind(TAC)>  x<-cbind(TA,REV,PPE,ROA)>
> pdata<-plm.data(beer,index=c("Company","Year"))>
> pooling<-plm(y~x,data=pdata,model="pooling")>  summary(pooling)Oneway
> (individual) effect Pooling Model
>
> Call:
> plm(formula = y ~ x, data = pdata, model = "pooling")
>
> Balanced Panel: n=14, T=10, N=140
>
> Residuals :
>      Min.  1st Qu.   Median  3rd Qu.     Max.
> -3.70000 -0.20500 -0.00497  0.19400  1.16000
>
> Coefficients :
>                Estimate Std. Error t-value  Pr(>|t|)
> (Intercept)  -0.048250   0.094661 -0.5097 0.6110848
> xTA         -68.865413  25.424371 -2.7086 0.0076314 **
> xREV          0.363786   0.092291  3.9417 0.0001293 ***
> xPPE          0.551753   0.202364  2.7265 0.0072501 **
> xROA          0.953009   0.031102 30.6414<  2.2e-16 ***
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> Total Sum of Squares:    426.26
> Residual Sum of Squares: 32.02
> R-Squared      :  0.92488
>        Adj. R-Squared :  0.89185
> F-statistic: 415.539 on 4 and 135 DF, p-value:<  2.22e-16Warning
> messages:1: In if (is.na(le)) { :
>    the condition has length>  1 and only the first element will be
> used2: In if (is.na(le)) " __no length(.)__ " else if (give.length) {
> :
>    the condition has length>  1 and only the first element will be
> used3: In if (le>  0) paste0("[1:", paste(le), "]") else "(0)" :
>    the condition has length>  1 and only the first element will be used
>
>> After running I found this warnings message. would some help me to find
> out this problem.

Hi Ramesh,
This warning is given when a vector like this:

le<-c(4,2,6,5)

is used in a test like this:

if(is.na(le)) ...

R only looks at the first value in the vector for the test, but warns 
you that there were other values that were not tested. If the test was:

if(is.na(le[1]))

It doesn't matter if "le" has only one value or more than one and you 
don't get the warning. It usually doesn't mess anything up.

Jim



More information about the R-help mailing list