Tuesday, December 20, 2011

Stata Code Snippets: Plotting Multiple Series with Different Colors and Customized Legend for Different Observations

Here are some Stata code snippets for plotting multiple series. An example using the auto dataset that comes with Stata:

sysuse auto
twoway (scatter price weight if foreign == 1, mcolor(`f0')) (scatter price weight if foreign == 0, mcolor(`f1')),legend(lab(1 "Foreign") lab(2 "Domestic"))

The resulting graph shows domestic cars in the late 70s tend to be heavier for various price points.

image

Reference: st: RE: –twoway scatter- different colors for different observations [Statalist: The Stata Listserver], Stata Learning Module Graphics: Combining Twoway Scatterplots [UCLA Academic Technology Services]

Sunday, December 18, 2011

Stop the Windows 7 or Vista Screen from Locking Up when User Account Control (UAC) Elevate a Program to have Administrator Access

The How-To Geek has an article on editing the Windows registry to stop the screen from blacking out and locking up when a program need administrator access (i.e., run as an administrator). I found that this is possible while trying a tweaking program named Tweak Me!.

For Windows Vista, you need to edit [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] and set PromptOnSecureDesktop to 0.

I.e.,

image

Reference: Make User Account Control (UAC) Stop Blacking Out the Screen in Windows 7 or Vista [How-To Geek]

Monday, December 12, 2011

Tracking Job Posts and Announcements on ERN (Economics Research Network)

I have blogged indirectly about this before: using page2rss.com to create a RSS feed that updates the reader a site changes. Among other things, I have been using this for Economics Research Network's Professional Announcements, and this works quite well save for the hard to read formatting. Here is an example of what the RSS feed looks like:

image

This is rather difficult to read, but it serves its purpose of alerting me to new conferences or job postings that went up on ERN. For email alerts, you can use this together with Yahoo alerts – which you can setup to have an email send to you when the RSS feed updates. However, I have been having issues with that Yahoo service (previous blog posting on this topic).

The two ERN links I check are:

http://www.ssrn.com/update/ern/ernann/ern_ann.html (http://page2rss.com/rss/1cc62dfaf49c436e2da76ef98ed4c53e)

http://www.ssrn.com/update/ern/ernjob/ern_job.html (http://page2rss.com/rss/33f5a81d12a753bc9c2bf9b99602ee87)

Wednesday, December 7, 2011

Making Text from PDF Files Searchable from the “Start Search” Text Box

This is in reference to an earlier post here on installing iFilter to make more filetypes searchable in Windows.

Supposedly, from the Adobe website: “Adobe currently bundles a 32-bit PDF iFilter with Adobe Acrobat® 9 as well as free Adobe Reader® 9 software.”  I have a 64-bit Windows 7 machine that has Adobe Acrobat 9 installed, but the iFilter was not setup. The iFilter works after I install Adobe PDF iFilter 9.

The Adobe setup file can be downloaded here: https://www.adobe.com/support/downloads/detail.jsp?ftpID=4025 .

Friday, December 2, 2011

Stata Code Snippets: Finding Duplicates in Observations

Here are some code Stata code snippets for checking duplicates in your panel data. (I have to figure out how to do this because my panel dataset have duplicates, and therefore I cannot do a tsset on the data) The command to use is duplicates.

To list any duplicate observations, run:

duplicates list

For the duplication issue I have with tssset, I specific the two relevant panel variables

duplicates list termtype dateIndex

Now, to create a dummy variable isdup to mark the duplicates

duplicates tag termtype dateIndex, gen(isdup)

In my case, I just manually remove the duplicates using the graphical editor:

edit if isdup

Or, to just remove it using the command

duplicates drop termtype dateIndex

An example:

sysuse auto
keep mpg rep78
duplicates list
duplicates list rep78
duplicates tag rep78, gen(isdup)
list if isdup