Title: How long does the spmatrix take to create contiguity matrixes?
Tags: matrix;regression;stata;spatial;spatial-regression
Question: I've been trying to do spatial regressions for a paper. Now I have the problem that I need contiguity or inverse distance matrixes for this. I've been using an official shapefile for the communities in Germany for this. Making it a few thousand cases.
Now I've been running the command &quot;spmatrix create contiguity Wc&quot; on my computer for two hours, but it looks more like Stata crashed than it'll ever finish the calculations. I've been using Stata 15 IC.
Am I doing something wrong? Is there some way to restrain the matrix creation process so it'll go faster - like only allow a certain distance?
Comment: I have no experience with this problem but it doesn't seem surprising that the calculation is slow. That's a massive matrix. There can't be a hook here, as I understand it, as the code would have to calculate a distance before it could tell whether it is too large.

Comment: You have a problem but I don't think it's a problem that allows more than guesses, so I think this is off-topic here.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:01/24/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<matrix><regression><stata><spatial><spatial-regression>', 'Title': 'How long does the spmatrix take to create contiguity matrixes?', 'ViewCount': 55, 'id': 70834071, 'user_AboutMe': None, 'user_AccountId': 19904146.0, 'user_DisplayName': 'Timo ', 'user_Reputation': 21.0, 'user_Views': 1.0, 'user_id': 15153475.0}}