Home
CV
Research
Classes
Personal

 
 
 

Sandip Sukhtankar - Data & Code

Setting up Stata mode in WinEdt for Windows 7/ Stata 12 MP

I have been using WinEdt as my text editor for Stata/ R/ LaTeX since 2007 now, using the Stata mode for Winedt written by Philip Greenwood. The Stata mode was written in 2003, and doesn't work with the latest version of WinEdt (7). Which is fine, I'm happy to keep using WinEdt 5.5. However, even the Stata mode/ WinEdt 5.5 system doesn't work with Windows 7/ Stata 12 without the following fixes (I assume you have already read the instructions), which you need to make BEFORE running the "Install.edt" macro:
  • First, note that the Application data for WinEdt is stored in Users\Your_name\AppData\Roaming\WinEdt, so you will have to extract the Stata mode into the "config" folder here. To find this easily (Windows 7 hides it and makes it difficult to find), either type in the address above or just go through the WinEdt configuration wizard (first tab has "Browse Application Data") at the bottom right).
  • Second, you should make sure that WinEdt is the default application to open ".edt" files; again you can use the WinEdt configuration wizard to do this. Otherwise Windows 7 makes it impossible to open the installation macros from within the AppData folder (and it doesn't let you navigate to the hidden AppData folder from the Open file menu within WinEdt).
  • Next, you need to make the following fix to the "extract_path.edt" macro (as helpfully suggested here): Change line 11 to "LetRegNum(8,12)". This will allow the macro to search for Stata versions beyond Stata 10!
  • Then you need to make the following change to the "run_DO.edt" and "run_DO_batch.edt" macros: remove the "/k66000" from the line: WinExe('',|%$('wstata'); /k66000 do "%n" |,'%p','',101111, 1); Without this fix you will get an error message from Stata.
  • Now you can execute the "Install.edt" macro.
  • One final issue is that the installation seems to blank out names of open files in the tabs. You can fix this by right-clicking on the greyed-out tabs and unselecting "Custom colors" from the drop-down menu.
Hopefully this works for you as it did for me (after much trial and error)!
Indian Assembly Constituency Maps:
If you have tried mapping the Assembly Constituency map files provided by the Election Commission of India, you will notice that somehow the constituencies appear to be in the middle of the Mediterranean, and hence do not overlap with any other Indian maps you might use like those of districts or parliamentary constituencies. Outraged that the ECI will not provide the correct GIS files and that private companies have been charging $2000 for the correctly mapped files, I went ahead and did some of my own corrections, and am providing the corrected shapefile for free to anyone who wishes to use it for research purposes. All I ask in return is that you give me credit, and to please share if you make any improvements.

Update June 2011: Note that these are constituency maps before delimitation (i.e. before 2009 elections). More recent maps may be available from the ECI.
    Disclaimers
  • I make no claims whatsoever about the accuracy of these corrections. They have been created in ArcMap using linking and rubbersheeting with noticeable physical features. Use at your own risk, and definitely do not expect the map to be anywhere close to accurate at the village level.

  • The state of Uttaranchal, rather than being joined to its neighbors in the middle of the Mediterranean, actually finds itself in the Arctic. I only noticed this after working on the maps for a while, and have not yet managed to join it to the rest of the states. UPDATE 2012: The Uttaranchal data was very helpfully added to the dataset by Manasa Patnam. The link below now has the full data, and you should acknowledge Manasa too if you use the data.

  • Again, use at your own risk, and do not hold me liable for any mistakes!
The Zipped files