Deals on Stata book

Saturday, October 31, 2009


a gentle introduction 3rd.png
A gentle introduction to Stata 


This is a perfect book for beginners.


There are 13 chapters:
1 Getting started
2 Entering data
3 Preparing data for analysis
4 Working with commands, do-files, and results
5 Descriptive statistics and graphs for one variable
6 Statistics and graphs for two categorical variables
7 Tests for one or two means
8 Bivariate regression and correlation
9 Analysis of variance
10 Multiple regression
11 Logistic regression
12 Measurement, reliability, and validity
13 Appendix: What's next?

I like this book because it covers concepts related to statistics as well as their application in a single book. It also tells you how to interpret the results obtained from the Stata output. For example, on page 178, after running a multiple regression:

regress csat expense percent income high college

the results with multiple regression equation are shown :

predicted csat = 851.56 + .00335 expense – 2.618 percent + .0001 income + 1.63 high + 2.03 college

This book also provides helpful interpretations:
Controlling for four other variables weakens the coefficient on expense from –.0223 to .00335, which is no longer statistically distinguishable from zero. The unexpected negative relationship between expense and csat found in our earlier simple regression evidently is spurious, and explained by other predictors.
Only the coefficient on percent (percentage of high school graduates taking the SAT) attains significance at the .05 level. We could interpret this “fourth-orer partial regression coefficient” (so called because its calculation adjusts for four other predictors) as follows.
This book includes many graphs, and when I learn stats I like to see what the results look like. This helps me to understand and remember the concepts I have studied. Visit A gentle introduction to Stata and find out today's deal on Amazon.

Stata: How to export descriptive statistics tables?

Friday, September 25, 2009

When performing statistics analysis, the first thing you would probably do is to run descriptive statistics. Knowing how to export tables of descriptive statistics can save a considerable amount of time.

If you would like to obtain the exact results that I did, you could use the following code for your  dataset:

use http://twtcsl.org/dataset/gss2000.dta
tab race
tab race sex
sum race sex age income
tab race, gen(d)
rename d1 dwhite
rename d2 dblack
rename d3 dother
tab sex, gen(d)
rename d1 dmale
rename d2 dfemale
sum dwhite dblack dother dmale age income if !mi(age) & !mi(income)


The results:

5.png

How do we export it? You can use EDIT-COPY TABLE in stata dropdown menu, or write some code to do the work.

estpost sum dwhite dblack dother dmale age income if !mi(age) & !mi(income)
esttab using sum2.rtf, cells("mean(fmt(2)) sd(fmt(2)) min(fmt(1)) max(fmt(0))") nomtitle nonumber replace


The export table looks like this:
1.png

To obtain three digits after the decimal point, change fmt(2) to fmt(3).

If you require more advanced descriptive statistics tables, for example, if you wanted to determine age and income by race, you could use the following codes:

sort race
by race: eststo: estpost sum age income if !mi(age) & !mi(income)
esttab using grp_sum.rtf, cells("mean(fmt(2)) sd(fmt(2))") replace


This result in a neat table:
2.png
If you are unable to export tables, check this article
Stata: Export OLS regression table to Word or Excel
and install the estout package.
 

Stata: Dealing with missing values

Friday, September 4, 2009

Dealing with missing values is probably the first thing you do after labeling your variables. Unfortunately, this is not an easy job and many users use inappropriate means to accomplish it. Let’s start at the very beginning.

In Stata 7 and previous versions use only one default missing value “.” (without quote). If you wish to exclude missing values, it would be correct to use the:

if variable !=.

Sample code for OLS regression would resemble the following part:

regress a b if c!=. & d!=.
regress a b c if d!=.
regress a b c d


This would be 100% correct if you used an old Stata dataset; however, if your dataset in had different missing values, this code would be problematic. Stata 8 and later versions allows you do define different types of missing values, each of which begins with a “.” (without quote), such as .a, and .b. Therefore, if you have these missing values in your dataset and you use old code like that above, you would probably obtain inconsistent observation numbers.

The correct way to perform this would be to use if c <. or if  !mi(c). The revised code would similar to:

regress a b if !mi(c) & !mi(d)
regress a b c if !mi(d)
regress a b c d


What if you have 20 variables in your regression? Such if statements often result in very long lines, thereby reducing the readability of your code. There are two easy ways to overcome this: 1) creating a dummy called “touse” with 1 representing valid values for all variables; and 0 for at least one missing value.

gen touse =!mi(y, a, b, c, d)
regress y a b if touse
regress y a b c if touse
regress y a b c d if touse


2) If you don’t like this approach, you can also deal with missing values by using nestreg:

nestreg: reg y (a b) (c) (d)

Endnote: Inputing the name of orgnizations

Tuesday, August 4, 2009

Today, while I was typing a reference by Society for Technology in Education, the following picture appeared:

1.png

That means that it was messed up! Endnote had treated it as the name of a person, but that is not what I wanted. 

When you type a reference written by an organization, you have to perform one additional step. You have to type ",," (without quote) at the end of the name:

2.png

And it works!
3.png

Simple tips are really important!!

Solution: Skype uses more than 50% CPU

Tuesday, June 30, 2009

I cannot remember when it started, but everytime I used Skype, it took more than 5 minutes to log in and automatically logged me out soon. Even worse, I was not able to hear people properly while talking on Skype. This also occurred using other VOIP software, such as MSN.

Eventually, I found this post on the Skype forum: http://forum.skype.com/index.php?showtopic=367371&st=20

I am not the only person having this problem and it turns out that it is caused by ESET NOD32.  Check your ESET NOD32, and whether your personal firewall module is 1049 and your ESET NOD32 version is older than 3.0.684. For more detail, check here: http://kb.eset.com/esetkb/index?page=content&id=SOLN2277&cat=WINNT&actp=LIST

About ESET Smart Security window

Go to here http://www.eset.com/download/index.php and download the latest version, and you may also upgrade to version 4. According to an ESET announcement, “ESET Smart Security 4 and ESET NOD32 Antivirus 4 have arrived! Existing customers with a valid license for either product may upgrade to the latest version of the same product for free! Simply download the latest software and install it on your computer.”

ESL Assistant: Reduce your English writing errors

Saturday, June 27, 2009

ESL Assistant is a website developed by Microsoft with the goal of helping non-native-English speakers by identifying writing problems and suggesting improvements.

1.png

ESL Assistant: http://www.eslassistant.com/

Paste your writing into the text area and click check.
2.png

Errors are highlighted with green or red underlines. Move your mouse over these areas to display a pop-up suggestion box. Move your mouse over the suggestion box to display related keywords appearing in Bing, the new search engine developed by Microsoft. You may check these “sample sentences” and decide whether to follow the suggestions.

Keep in mind that this tool only provides suggestions, and does not necessarily identify all of your errors. In addition, this tool occasionally identifies errors, which are in fact grammatically correct.

EndNote X3 for Windows realeased!

Monday, June 22, 2009

The new version of Endnote for windows was realeased on June 17, 2009. There are many new features:
  • Format bibliographies in OpenOffice.org Writer 3
  • Group references and locate full text in new ways
  • Find More Full Text with EZProxy
  • Work on the desktop and Web


Students in North America can purchase EndNote X3 for $115.95 USD with a valid student I.D.