3

I am trying to run the following command on my dataset;

   pbad2way(formula = Balance~Occupation+Gender+Occupation:Gender, data = 
plxsell, est= "mom", nboot= 5000)

name of dataset is plxsell Balance, Occupation, Gender are the columns

but i am receiving following error;

Error in FUN(X[[i]], ...) : argument must be coercible to non-negative integer In addition: Warning message: In FUN(X[[i]], ...) : first element used of 'length.out' argument

Please help.

Thanks Akhil

akhicoda
  • 139
  • 1
  • 1
  • 12
  • 1
    Hey Akhil, the community would be much more helpful if you could make your question [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – OzanStats Jul 22 '18 at 15:27

1 Answers1

2

This error message appears when a function expects a number but receives something else.

For example the seq_len function expects a number:

seq_len(3) # no error, since function receives a number
seq_len(NA_character_) # Errors, since function expected a number and did not receive one
seq_len("a") # Errors, since function expected a number and did not receive one

You Should scrutinise your code and data for any instance where a function expects to receive a number but instead receives something else (like a character string or NA). NAs in your data could be a good place to start looking

stevec
  • 41,291
  • 27
  • 223
  • 311