Error in median.default(vardir) : need numeric data

Syntax: library(sae) eblupFH <- eblupFH(formula = income ~ urbanC + RuralC + HHsizeC + EmC + HBD1C + HBD2C + HBD3C + HBD4C + HBD5C + HBD6C + HBD7C + HBD8C + HBD9C + HBD10C + HBD11C + LivingSC + HowManyRoomsC + electricityC + heatingC + toiletC + sewerageC + bathroomC + hotwaterC + own1C + own2C + own3C + own4C + ownedlandC + ownedgardenC + femaleC + maleC + ageC + Nat1C + Nat2C + Nat3C + Nat4C + Nat5C + Nat6C + Nat7C + Nat8C + Nat9C + Nat10C + Migr1C + Migr2C + Migr3C + YearC1C + YearC2C + YearC3C + YearC4C + refugeestatusC + Edu1C + Edu2C + Edu3C + Edu4C + Edu5C + Edu6C + Edu7C + Edu8C + Edu9C + Edu10C + Edu11C + MRST1C + MRST2C + MRST3C + MRST4C + HealthstC + disabilitiesC + givematerialhelpC + takematerialhelpC + WholeLandC + numberofpicesC + grapesC + citrusesC + otherfruitsC + CattleC + BuffaloC + DonkeyC + HorseC + PigC + SheepC + GoatC + RabbitC + BeehiveC + PoultryC + tractorC + autoC, vardir = jem, method = "REML", MAXITER = 100, PRECISION = 0.0001, B = 0, data=vari)

what should be reason? I have already checked format of variance (variable name jem) and it is numeric there is not missing values and etc. I tried: 1) changing format as in excel as in r; 2) using different variable for testing, result is same; 3) excluded variable from formula; 4) updated r studio and sae package.

Hi AND WELCOME to the forum.

I think we need to see all of your code and some sample data. See
FAQ Asking Questions

A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here between
```

```

Thank you for attantion,

I tried also to estimate FH model from emdi syntax:
library(emdi)
fh_std <- fh(
fixed = income ~ urbanC + RuralC + HHsizeC + EmC + HBD1C + HBD2C + HBD3C + HBD4C + HBD5C + HBD6C + HBD7C + HBD8C + HBD9C + HBD10C + HBD11C + LivingSC + HowManyRoomsC + electricityC + heatingC + toiletC + sewerageC + bathroomC + hotwaterC + own1C + own2C + own3C + own4C + ownedlandC + ownedgardenC + femaleC + maleC + ageC + Nat1C + Nat2C + Nat3C + Nat4C + Nat5C + Nat6C + Nat7C + Nat8C + Nat9C + Nat10C + Migr1C + Migr2C + Migr3C + YearC1C + YearC2C + YearC3C + YearC4C + refugeestatusC + Edu1C + Edu2C + Edu3C + Edu4C + Edu5C + Edu6C + Edu7C + Edu8C + Edu9C + Edu10C + Edu11C + MRST1C + MRST2C + MRST3C + MRST4C + HealthstC + disabilitiesC + givematerialhelpC + takematerialhelpC + WholeLandC + numberofpicesC + grapesC + citrusesC + otherfruitsC + CattleC + BuffaloC + DonkeyC + HorseC + PigC + SheepC + GoatC + RabbitC + BeehiveC + PoultryC + tractorC + autoC, vardir = "jem",
combined_data = varidz, domains = "dist", method = "ml",
MSE = TRUE
)

an getting error "Error in I * psi[, 1] : non-numeric argument to binary operator"

then I renamed variables and datasets as it was in example in FH emdi package but result is same. dataset I have uploade on my drive varidz.xls - Google Sheets

I have not any idea why I am not able to view results of mentioned syntaxes

Just an equation is not likely to be of any help.

I think we need to see some sample data.
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here between
```

```

I think mentioned way not working.

I wrote dput(head(varidze, 100)) and then dput(output). console does not show me all output as it larger than console. Do we have another way to solve problem? Could you run syntax?, I have provided data via my google drive?

If you can supply a link to the data on your google drive that would be great. Otherwise you could put it on somethng like Dropbox or mediafire and give us a link.

Thanks.

this is link of excel file of my google drive

Got it, thanks.

I'm going out now bu should be able to have a look at it latter today . It's 11:25 EST here.

thank you for your time! I tried it many hour

Sorry to take so long to get back to you. I was busier that I expected and then this took a bit more time than I had expected . I think that at least you are running into colinearity issues. After that I am not sure.

I have identified 7 variables that seem to be causing problems but which variables they are in conflict with, I am not sure.

This will run, I hope.

dat1  <- read.csv("gmike.csv")

ebbb <- eblupFH(formula = income ~ urbanC + RuralC + HHsizeC + EmC + 
    HBD1C + HBD2C + HBD3C + HBD4C + HBD5C + HBD6C + HBD7C + HBD8C + HBD9C + 
    HBD10C + HBD11C +  LivingSC + HowManyRoomsC + electricityC + heatingC +
    toiletC + sewerageC  + bathroomC + hotwaterC  + own1C  + own2C  + own3C + own4C 
    + ownedlandC +ownedgardenC  + femaleC + ageC +
       Nat1C  + Nat4C + Nat5C + Nat6C + Nat7C + Nat8C + Nat9C +
    Migr1C + Migr2C + Migr3C + 
      
    YearC1C + YearC2C + YearC3C + YearC4C  + 
    refugeestatusC + 
      
    Edu1C + Edu2C + Edu3C + Edu4C + Edu5C + Edu6C + Edu7C + Edu8C + Edu9C + Edu10C + Edu11C  +
    MRST1C + MRST2C + MRST3C + MRST4C + 
  
    HealthstC + disabilitiesC + givematerialhelpC + takematerialhelpC + 
    WholeLandC + numberofpicesC +
      
    grapesC + citrusesC + otherfruitsC  +
      
    CattleC + BuffaloC + DonkeyC + HorseC + PigC + SheepC + RabbitC + autoC
    ,
vardir = jem, method = "REML", MAXITER = 100, PRECISION = 0.0001, B = 0, data= dat1)

These are the troublesome variables

dat2  <- dat1[, c( "maleC", "Nat2C" , "Nat10C", "GoatC" , "BeehiveC",
                   "tractorC", "autoC")]
cor(dat1$femaleC, dat1$maleC)

Thank you! I will try.

Dear friend,

I separated data file for two and named same as it was in the example of syntax, after that I ran and it works. maybe syntax uses variables from origin tables.

Thank you again for your time!

I am glad to see that things are working.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.