[R-sig-Geo] (no subject)

Joseph Duncan fairyland118 at gmail.com
Sun Dec 23 17:31:57 CET 2012


Hi Everyone

Happy Christmas!

I have tried several days but cannot solve the problem.  Can any one help
me ? Below is R command for a simple spatial regression. The data is
attached.


library(spdep)
library(sphet)
mat0 <- read.table("50state1.txt", header=FALSE, sep="\t", fill=TRUE)
mat <- as.matrix(mat0)
dim(mat)
summary(c(mat))
mat[is.na(mat)] <- 0
summary(c(mat))
lw <- mat2listw(mat, style="B")
summary(lw, zero.policy=TRUE)
is.symmetric.nb(lw$neighbours)

lit <- read.csv(file="lit1.csv", h=T, sep= ",")
sarml <- lagsarlm(lpax2010 ~ sh65up + lpoptot + lypc, data = lit, listw =
lw, method ="eigen", zero.policy=TRUE)
summary(sarml)


Thank you very much

 Fairy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20121223/8da92843/attachment.html>
-------------- next part --------------
									1	1														1																		1								
																																																		
				1																								1			1													1						
																		1						1	1											1						1	1							
		1																										1									1													
																1											1				1					1								1						1
																					1											1							1											
																				1										1								1												
																				1																										1				
1										1																																								
1									1																								1							1		1								
																																																		
																										1		1									1							1			1			1
														1	1		1					1			1																								1	
													1				1					1													1															
													1										1		1		1														1								1	
					1																				1		1									1														
													1	1											1										1							1				1		1		
			1																					1																			1							
																													1																					
							1	1																														1								1		1		
						1																							1			1							1						1					
													1	1									1												1														1	
															1							1												1							1								1	
1			1															1																								1								
			1										1		1	1	1										1									1						1								
												1																						1							1									1
					1										1	1									1																1									1
		1		1								1																									1							1						
																			1		1																								1					
							1																									1						1												
		1			1																															1							1							
						1															1									1								1							1					
										1																														1		1				1				
																							1			1															1									
														1			1					1																1										1		
			1		1											1									1						1												1							
				1								1																1																			1			
							1													1										1		1			1													1		
						1															1																													
										1																							1																	
															1								1			1	1							1																1
1			1							1							1							1	1								1													1				
			1															1													1					1														
		1			1							1																1																						1
																					1								1			1																		
								1									1			1													1									1						1		
												1																									1													
																	1			1															1			1								1			
												1		1							1	1																											
				1							1														1	1														1									
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lit1.csv
Type: text/csv
Size: 2479 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20121223/8da92843/attachment.bin>


More information about the R-sig-Geo mailing list