Skip to content

mat2listw function

3 messages · Jacquelyn Pless, Jim Lemon, David Winsemius

#
On 11/30/2013 07:05 AM, Jacquelyn Pless wrote:
Hi Jacquelyn,
The first thing I would do is enter:

sum(is.na(x))

and if anything other than zero is returned, you will know what's wrong. 
Your dataset has been imported from Excel, and that application is 
notorious for exporting things in the way it knows you want them to be. Not.

Jim
#
On Nov 30, 2013, at 1:43 AM, Jim Lemon wrote:

            
The second thing to do (since I wonder if an NA value would provoke that error) is to run 

class(matrix)

I'm guessing it's not a matrix and perhaps a dataframe. In which case then run:

lapply(matrix, class) to see if the columns are "numeric". I'm guessing they may be "factor".