- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to run a spatial regression with PROC SPATIALREG with a SPATIALID statement, but I keep getting the following error.
ERROR: The column 2 of data set WORK.A does not have a valid column name.
Dataset A to which the error refers is a 49x50 spatial weight matrix for 49 states with a spatial ID for each state as the first variable. The ID variable name is state_num in column 1, and all subsequent columns are labeled COL1...COL49.
Any help is appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please show the log containing not only the error messages, but the code you used.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My apologies. Here it is.
513 proc spatialreg
514 data = f wmat = a nonormalize;
515 model propa_bla = prop_bla aff_general aff_bla avgdma /type = sar;
516 spatialid state_num;
517 quit;
ERROR: The column 2 of data set WORK.A does not have a valid column name.
ERROR: This model cannot be fit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What's the column name of the second column in the data set A?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
COL1. Columns 2-50 are labeled COL1-COL49, respectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
They need to match per the documentation. So if you're using StateNumbers as Column1 the weights need to align so the matrix shows how State1 maps to State5 and it doesn't know that Column5 is actually State5 if the names are not identical.
Page 2377 here
https://support.sas.com/documentation/onlinedoc/ets/142/spatialreg.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I completely missed that when I looked through that document earlier. So I either need to rename the columns to match the state numbers or rename the state numbers to match COL1-COL49. I'm going to try that now.