tag:blogger.com,1999:blog-15297681889061267102024-03-08T12:46:51.761-08:0021st Century ResearchersIntroduce tools and software that researchers need to know in the 21st centuryUnknownnoreply@blogger.comBlogger19125tag:blogger.com,1999:blog-1529768188906126710.post-22532588761922078602012-05-21T20:50:00.001-07:002012-05-21T20:50:45.551-07:00Stata: Dealing with Date variables<p>Dealing with date variables in dataset requires additional steps. If not done correctly, your data format may not be consistent and you will get your value wrong. Here are some tips related to date variables. </p> <h2>Generating date variables</h2> <p>If you import your data from excel, your date variables may be treated as 1) string variables, or 2) integer (less likely). An example of date variable in string format is: 1 Jan 1960. If in integer format, it would be like 17869. These two formats can be easily converted into date format. </p> <h3>String format</h3> <h5><font style="font-weight: normal">If your value is like 1 Jan 1960, you can use the following code:</font></h5> <p><code>gen newvar = date(oldvar, "DMY”)</code></p> <p>After running this line, you will see that your value would be like 0, or 1046, because these values are stored in integer format. The value represents the days before or after 1 Jan, 1960. Positive value means after 1 Jan, 1960 and negative value means prior to the date. This format is commonly used in different dataset. Don’t be suprised and we will convert it to date format later. </p> <h3>Integer format</h3> <p>If your values are in integer format, you need the following line to convert it to date format. </p> <p>Simple version</p> <p><code>format newvar %d</code></p> <p>A bit complicated version:</p> <p><code>format %tdnn/dd/CCYY newvar <br /></code></p> <p>You can choose either one. </p> <h3>Date comparisons</h3> <p>Once you convert to date format, it is very easy to compare two dates. If you want to see how many days between two date variables, simply use gen command and use one minus another. </p> <h4>Add or minus from a date</h4> <p>If you want to add, for example, 120 days to your date variable or minus 120 days, it is very similar to date comparisons. Simply generate another variable, which equals to your date variable add or minus 120 days. </p> <h4>Comparison with a specific date</h4> <p>If you want to compare a date varialbe with a specific date, such as 1 Jan 2000, you can use the following code:</p> <p><code>gen newvar = (mdy(1,1,2000) - oldvar) </code></p> <p>The code above will show you how many days before or after 1 Jan, 2000. If your date varialbe is birthday, you can divide the value with 365.25 and get how old your participants are on 1 Jan, 2000. </p> <p><strong>Further reading</strong></p> <p>Using dates in Stata <a href="http://www.ats.ucla.edu/stat/stata/modules/dates.htm">http://www.ats.ucla.edu/stat/stata/modules/dates.htm</a></p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-64760255156214101052012-04-27T23:18:00.000-07:002012-04-27T23:18:01.744-07:00How to know if one journal is a SSCI or SCI journal?SCI stands for science citation index, and SSCI stands for social science citation index. I personally do not think SCI and SSCI are very important in American academia; however, in some countries, such as Taiwan and China, SSCI and SCI are used to rank universities. In this situation, knowing your target journal is SCI or SSCI journal is critical.<br />
<br />
A couple ways to achieve this goal.<br />
<br />
1) Check out at SCI and SSCI official site (recommendation: 4 out of 5)<br />
<br />
<b></b><br />
SCI: <a href="http://science.thomsonreuters.com/cgi-bin/jrnlst/jloptions.cgi?PC=D" title="http://science.thomsonreuters.com/cgi-bin/jrnlst/jloptions.cgi?PC=D">http://science.thomsonreuters.com/cgi-bin/jrnlst/jloptions.cgi?PC=D</a><br />
SSCI: <a href="http://www.thomsonscientific.com/cgi-bin/jrnlst/jloptions.cgi?PC=J" title="http://www.thomsonscientific.com/cgi-bin/jrnlst/jloptions.cgi?PC=J">http://www.thomsonscientific.com/cgi-bin/jrnlst/jloptions.cgi?PC=J</a> <br />
<br />
Take SSCI site for example. If I want to know if <i>Foreign Language Annals</i> is a SSCI journal, simply typing foreign in the search box.<br />
<a href="http://www.flickr.com/photos/29041369@N06/3408065322/" title="1.png"><img alt="1.png" border="0" src="http://farm4.static.flickr.com/3396/3408065322_20fd666d91.jpg" /></a> <br />
Hit search and you will see the results. Voila, it is a SSCI journal. <br />
<a href="http://www.flickr.com/photos/29041369@N06/3408065484/" title="2.png"><img alt="2.png" border="0" src="http://farm4.static.flickr.com/3040/3408065484_4cd1a7e11d.jpg" /></a> <br />
<br />
<br />
The second approach (recommendation: 5 out of 5) is to use the following site:<br />
<br />
<a href="http://publik.tuwien.ac.at/info/sci_search.php?lang=2" title="http://publik.tuwien.ac.at/info/sci_search.php?lang=2">http://publik.tuwien.ac.at/info/sci_search.php?lang=2</a><br />
<br />
This site is self-explanatory, and I do not see the need to do any screen capturing. <br />
<br />
<br />
The third approach is to use Web of Science (recommendation: 3 out of 5), but it requires annual subscription. Please check your library and see if they subscribe it. <br />
<br />
<br />
<a href="http://apps.isiknowledge.com/WOS_GeneralSearch_input.do?product=WOS&search_mode=GeneralSearch&preferencesSaved=" title="http://apps.isiknowledge.com/WOS_GeneralSearch_input.do?product=WOS&search_mode=GeneralSearch&preferencesSaved=">http://apps.isiknowledge.com/WOS_GeneralSearch_input.do?product=WOS&search_mode=GeneralSearch&preferencesSaved=</a><br />
<br />
Select publication name and type foreign l*.<a href="http://www.flickr.com/photos/29041369@N06/3433603136/" title="3.png"><img alt="3.png" border="0" hspace="hspace" src="http://farm4.static.flickr.com/3643/3433603136_869afed2e5.jpg" /></a><br />
<br />
Click analyze result.<br />
<a href="http://www.flickr.com/photos/29041369@N06/3433603312/" title="4.png"><img alt="4.png" border="0" hspace="hspace" src="http://farm4.static.flickr.com/3299/3433603312_fc57dde033.jpg" /></a><br />
<br />
It will shoe fields that you can analyze. Since we are looking for the journal, please choose source title ad click analyze.<br />
<a href="http://www.flickr.com/photos/29041369@N06/3432792545/" title="5.png"><img alt="5.png" border="0" hspace="hspace" src="http://farm4.static.flickr.com/3546/3432792545_0403204072.jpg" /></a><br />
<br />
The fourth approach is to use Journal Citation Report, but this one also require library subscription (recommendation: 4 out of 5). <br />
<br /> <br />
<a href="http://admin-apps.isiknowledge.com/JCR/JCR" title="http://admin-apps.isiknowledge.com/JCR/JCR">http://admin-apps.isiknowledge.com/JCR/JCR</a> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-18500438107237509332012-04-25T17:51:00.001-07:002012-04-27T23:03:08.140-07:00Stata: Count groups by individualsOne friend asked me the following question:<br />
<br />
How can I transform the following format into:<br />
<br />
id level <br />
1 A <br />
1 A <br />
1 B <br />
2 A <br />
2 B <br />
3 B <br />
<br />
<br />
<br />
<br />
<br />
<br />
this one?<br />
<br />
id level #ofA #ofB <br />
1 A 2 1 <br />
1 A 2 1 <br />
1 B 2 1 <br />
2 A 1 1 <br />
2 B 1 1 <br />
3 B 0 1<br />
<br />
Well, I do not think there is one command for this task. This is not very difficult if there are only two groups to count. <br />
<br />
The way I achieve this task is:<br />
<br />
<code>use "http://images.researcher20.com/stata_group/stata_group.dta", clear <br />egen acount = group(level) <br />gsort +id +acount <br />by id: egen acount2 = count(acount) if acount==1 <br />bys id: replace acount2 = acount2[_n-1] if acount2==. <br />replace acount2=0 if acount2==. <br />bys id: egen bcount2 = count(acount) if acount==2 <br />gsort +id -level <br />by id: replace bcount2 = bcount2[_n-1] if bcount2==. <br />replace bcount2=0 if bcount2==. </code><br />
<br />
Level variable is a string variable, so I use egen to get a group id. If you are interested in learning more details, you can check my previous post:<a href="http://21cresearcher.blogspot.com/2012/04/stata-create-id-by-group.html">Stata: Create id by group.</a><br />
<br />
After creating a new group id, I sort id and level. How do I count how many As and Bs? I count # of As using egen, but you may notice that if the value is B, # of A would be missing. So my next step is to fill up this missing with the value of previous record. This is why I sorted data at the beginning.<br />
<br />
If there is no A, then replace the value from missing to zero.<br />
<br />
The way I count # of Bs is similar. The only difference is sorting.<br />
<br />
You may be curious: how about if I have more than three groups? Well, my code only works for two groups, and I have not found a way to count three groups by individuals.<br />
<br />
If you have tips or code to achieve the task, please let me know!<br />
<br />
Update <br />
2012.4.27: <br />
<br />
One friend shared with me her code:<br />
<code>
foreach i in A B C D E F G H I J K L N P Q R S T U V W X Y Z {<br />bys id: egen nof`i'=sum(level=="`i'")<code>}</code></code>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-10319747163117318122012-04-22T09:59:00.001-07:002012-04-22T09:59:40.029-07:00Stata: Create id by groupWhen doing your data analysis, sometimes you will encounter the following situation: in your dataset, everyone has an unique id. However, their IDs are long and each participant has multiple record (or the dataset is in a long format).<br />
<br />
To visualize your data, you need to create a new ID for each individual regardless of how many records each person has. For example, the first person has three records, and we would like to assign a new ID 1 for the first person, and the second person would be 2.<br />
<br />
Though it sounds difficult and tedious, it is not difficult to do so. <br />
<br />
<code>egen id = group(oldid)</code> <br />
<br />
Just one line and your problem will be solved.<br />
<br />
Reference: <a href="http://www.stata.com/support/faqs/data/group.html" title="http://www.stata.com/support/faqs/data/group.html">http://www.stata.com/support/faqs/data/group.html</a>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1529768188906126710.post-79605077394633360002011-05-14T17:45:00.001-07:002011-05-14T17:45:20.862-07:00Stata tutorial index<h5><font style="font-weight: normal">This is an idex page for Stata tutorial I have written on this blog. I will update this index if I write more. This index also reminds me what I should have written. </font></h5> <h2>Data management</h2> <p><a href="http://21cresearcher.blogspot.com/2009/09/stata-how-to-deal-with-missing-values.html">Stata: How to deal with missing values?</a></p> <h2>Export</h2> <h5><a href="http://21cresearcher.blogspot.com/2009/05/stata-export-ols-regression-table-to.html"><a href="http://21cresearcher.blogspot.com/2009/09/stata-how-to-export-descriptive.html">Stata: How to export descriptive statistics tables?</a></a></h5> <h5><a href="http://21cresearcher.blogspot.com/2009/06/stata-output-correlation-table.html">Stata: Output correlation table</a></h5> <h5><a href="http://21cresearcher.blogspot.com/2009/05/stata-export-ols-regression-table-to.html">Stata: Export OLS regression table to Word or Excel</a></h5> <h5><a href="http://21cresearcher.blogspot.com/2009/06/stata-export-logistic-regression.html">Stata: Export Logistic Regression (Coefficient/Odds ratio) to Word or Excel</a></h5> <h2>Graph </h2> <h5><a href="http://21cresearcher.blogspot.com/2009/12/stata-draw-regression-lines-across.html">Stata: Draw regression lines across groups</a></h5> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-76884281001711154592011-05-14T16:53:00.001-07:002012-04-22T09:54:18.191-07:00Endnote: Using Filter to import from CSA ILLUMINA (EndNote X4 compatible)If you are in psychology or education, you would probably use CSA Illumina or Psycinfo a great deal. Sometimes you need to save time by importing references from CSA Illumina or Psycinfo. It is important to note that the correct filter is required for everything to work properly.<br />
<br />
How do we do that?<br />
<br />
I used an article from CSA Illumina for example:Melby, J. N., Conger, R. D., Fang, S.-A., Wickrama, K. A. S., & Conger, K. J. (2008). Adolescent family experiences and educational attainment during early adulthood. Developmental Psychology, 44(6), 1519-1536. <br />
<br />
After locating the file, you will see a “Save, Print, Email” option at the top. Click it. <br />
<a href="http://www.flickr.com/photos/29041369@N06/3154507018/"><img alt="1.png" border="0" src="http://farm4.static.flickr.com/3246/3154507018_11e34c0d11.jpg" /></a><br />
<br />
Choose current view record and use full format without references. I personally do not like to import references from the article because these references may not meet your requirements<br />
. <br />
Then click “save”<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3154507188/"><img alt="2.png" border="0" src="http://farm4.static.flickr.com/3289/3154507188_59c0e169af.jpg" /></a><br />
<br />
Open this txt using endnote.exe, and EndNote will ask you to choose the right filter. We selected<b> e-psyche (CSA).</b><br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/5711498962/"><img alt="6.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2282/5711498962_85e6a0bb9b.jpg" /></a><br />
<br />
The reference should then appear in your endnote library. <br />
<a href="http://www.flickr.com/photos/29041369@N06/3154507452/"><img alt="5.png" border="0" src="http://farm4.static.flickr.com/3075/3154507452_df835d9d3c.jpg" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-14541417869179048622010-04-29T13:25:00.001-07:002012-04-21T23:29:57.503-07:00Packing list for conferencesPacking<br />
<ul>
<li>Passport or Photo ID (i.e., driver license)</li>
<li>Boarding pass </li>
<li>Camera (with charger and cable line)</li>
<li>Laptop (and charger)</li>
<li>Clothes, socks, and PJs</li>
<li>Umbrella </li>
<li>Mobile phone (and charger)</li>
<li>Toothbrush and toothpaste</li>
<li>Medicine (in case if you have a cold or stomach ache) </li>
<li>Lip balm</li>
<li>Dollar bills (in case you want to leave tips)</li>
<li>Business cards</li>
<li>Hotel and transportation information </li>
<li>Nail clippers (in case you travel for a long time)</li>
<li>Comb</li>
<li>Flash drive (in case you want to share your files or use other people’s computer) </li>
<li>Slippers</li>
<li>Perfume </li>
</ul>
Before you leave<br />
<ul>
<li>Backup your files in your laptop</li>
<li>Delete sensitive data (in case you use restricted dataset or you have private files)</li>
<li>Set your alarm</li>
<li>Copy your passport and other official documents </li>
</ul>
Updates:<br />
2010.5.11: added perfume, shave, and necktie.<br />
2010.5.12: added backing up passport and documents<br />
<ul> </ul>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1529768188906126710.post-38555851930329347392009-12-18T12:25:00.001-08:002012-04-21T20:55:34.944-07:00Stata: Drawing regression lines across groupsWhen performing regression, one commonly compare groups, and the simple way to observe the differences is through graphs. Stata offers several ways to draw graphs. Here are two options.<br />
<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/4136277561/"><img alt="1.png" border="0" height="312" hspace="0" src="http://farm3.static.flickr.com/2564/4136277561_8b76b48dbb.jpg" width="404" /></a> <br />
Option 1:<br />
<br />
<code>regress inc educ male, beta <br />predict incfnoi if male==0 <br />predict incmnoi if male==1 <br />twoway (connected incmnoi educ if male==1, lcolor(black) /// <br />lpattern(dot) msymbol(diamond) msize(large)) /// <br />(connected incfno educ if male ==0, lcolor(black) /// <br />lpattern(solid) msymbol(circle) msize(large)), /// <br />ytitle(Income in thousands) xtitle(Education) /// <br />legend(order(1 "Men" 2 "Women")) scheme(s2manual) </code><br />
<br />
This code snippet is from <b><a href="http://www.amazon.com/gp/product/1597180750/ref=as_li_ss_tl?ie=UTF8&tag=21cr-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=1597180750" rel="nofollow" target="_blank">A gentle introduction to Stata</a>. </b>The results are presented above. <br />
Option 2: <br />
<br />
Install the two packages first:<br />
<br />
<code>net describe postgr3, from(<a href="http://www.ats.ucla.edu/stat/stata/ado/analysis">http://www.ats.ucla.edu/stat/stata/ado/analysis</a>) <br />net install postgr3.pkg <br />net describe xi3, from(<a href="http://www.ats.ucla.edu/stat/stata/ado/analysis">http://www.ats.ucla.edu/stat/stata/ado/analysis</a>) <br />net install xi3.pkg </code><br />
<br />
followed by the code:<br />
<br />
<code>xi3: regress inc educ male, beta <br />postgr3 educ, by(male) table</code><br />
<br />
Just two lines, isn’t that cool? Umm? <b>Do you notice anything wrong?</b> If you don’t like footnotes, such as yhat_, male==0, you can click the highlighted part below and make some changes.<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/4137040582/"><img alt="2.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2740/4137040582_c7900692de.jpg" /></a> <br />
<br />
Select the area you wish to change, and change it in the area indicated by the red arrow. <br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/4137040780/"><img alt="3.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2741/4137040780_9040a3f595.jpg" /></a> <br />
<br />
This also provides a table with which to ensure everything is correct. <br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/4137040934/"><img alt="4.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2557/4137040934_a5480080c3.jpg" /></a> <br />
<br />
You can get more information on the UCLA website here: <a href="http://www.ats.ucla.edu/stat/stata/ado/analysis/postgr3.htm">http://www.ats.ucla.edu/stat/stata/ado/analysis/postgr3.htm</a> <br />
<br />
You can also use predxcat and predxcon, with the command findit to get these two packages. I think that options 1 and 2 are adequate. Option 2 also allows you to draw interaction easily. I’ll talk about this in my next post.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-18107350159129453142009-10-31T10:24:00.001-07:002012-04-21T20:54:58.135-07:00Deals on Stata book<br />
<a href="http://www.amazon.com/gp/product/1597180750/ref=as_li_ss_tl?ie=UTF8&tag=21cr-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=1597180750" rel="nofollow" target="_blank"><img alt="a gentle introduction 3rd.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3261/5719904745_82cb321ab8.jpg" /></a><br />
<a href="http://www.amazon.com/gp/product/1597180750/ref=as_li_ss_tl?ie=UTF8&tag=21cr-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=1597180750" rel="nofollow" target="_blank">A gentle introduction to Stata </a><br />
<br />
<br />
This is a perfect book for beginners.<br />
<br />
<img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=researc20-20&l=as2&o=1&a=1597180432" style="border-bottom-style: none! important; border-left-style: none! important; border-right-style: none! important; border-top-style: none! important; margin: 0px;" width="1" /><a href="http://www.amazon.com/gp/product/1597180432?ie=UTF8&tag=researc20-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=1597180432"></a><br />
There are 13 chapters:<br />
1 Getting started <br />
2 Entering data <br />
3 Preparing data for analysis <br />
4 Working with commands, do-files, and results <br />
5 Descriptive statistics and graphs for one variable <br />
6 Statistics and graphs for two categorical variables <br />
7 Tests for one or two means <br />
8 Bivariate regression and correlation <br />
9 Analysis of variance <br />
10 Multiple regression <br />
11 Logistic regression <br />
12 Measurement, reliability, and validity <br />
13 Appendix: What's next?<br />
<br />
I like this book because it covers <b><span style="color: red;">concepts related to statistics as well as their application</span></b> 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:<br />
<br />
<code>regress csat expense percent income high college</code> <br />
<br />
the results with multiple regression equation are shown :<br />
<br />
predicted csat = 851.56 + .00335 expense – 2.618 percent + .0001 income + 1.63 high + 2.03 college<br />
<br />
This book also provides helpful interpretations:<br />
<blockquote>
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. <br />
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. </blockquote>
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 href="http://www.amazon.com/gp/product/1597180750/ref=as_li_ss_tl?ie=UTF8&tag=researc20-20&linkCode=as2&camp=217145&creative=399349&creativeASIN=1597180750">A gentle introduction to Stata and find out today's deal on Amazon. </a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-23319248086474374692009-09-25T12:03:00.001-07:002012-04-21T21:34:59.161-07:00Stata: How to export descriptive statistics tables?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. <br /> <br />If you would like to obtain the exact results that I did, you could use the following code for your dataset:<br />
<br />
<code>use http://twtcsl.org/dataset/gss2000.dta <br />tab race <br />tab race sex <br />sum race sex age income <br />tab race, gen(d) <br />rename d1 dwhite <br />rename d2 dblack <br />rename d3 dother <br />tab sex, gen(d) <br />rename d1 dmale <br />rename d2 dfemale <br />sum dwhite dblack dother dmale age income if !mi(age) & !mi(income) </code><br />
<br />
The results: <br /> <br /><a href="http://www.flickr.com/photos/29041369@N06/3531507507/"><img alt="5.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2323/3531507507_1e2e300e3b.jpg" /></a><br />
<br />
How do we export it? You can use <b>EDIT-COPY TABLE in stata dropdown menu</b>, or<b> </b>write some code to do the work.<br />
<br />
<code>estpost sum dwhite dblack dother dmale age income if !mi(age) & !mi(income) <br />esttab using sum2.rtf, cells("mean(fmt(2)) sd(fmt(2)) min(fmt(1)) max(fmt(0))") nomtitle nonumber replace </code> <br /><br />
The export table looks like this:<br />
<a href="http://www.flickr.com/photos/29041369@N06/3893602476/"><img alt="1.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3477/3893602476_20f91098ba.jpg" /></a><br />
<br />
To obtain<b> <span style="color: red;">three</span> digits after the decimal point</b>, change fmt(2) to fmt(<b><span style="color: red;">3</span></b>).<br />
<br />
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:<br />
<br />
<code>sort race <br />by race: eststo: estpost sum age income if !mi(age) & !mi(income) <br />esttab using grp_sum.rtf, cells("mean(fmt(2)) sd(fmt(2))") replace </code><br />
<br />
This result in a neat table: <br />
<a href="http://www.flickr.com/photos/29041369@N06/3892814629/"><img alt="2.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2538/3892814629_7bc73bda30.jpg" /></a><br />
If you are unable to export tables, check this article <br />
<h5>
<a href="http://21cresearcher.blogspot.com/2009/05/stata-export-ols-regression-table-to.html">Stata: Export OLS regression table to Word or Excel</a></h5>
and install the estout package. <br />
<h5>
<a href="http://21cresearcher.blogspot.com/2009/05/stata-export-ols-regression-table-to.html"> </a></h5>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-49840703972689122212009-09-04T15:55:00.001-07:002012-04-21T20:31:24.301-07:00Stata: Dealing with missing valuesDealing 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. <br />
<br />
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:<br />
<br />
<b>if variable !=.</b> <br />
<br />
Sample code for OLS regression would resemble the following part:<br />
<br />
<code>regress a b if c!=. & d!=. <br />regress a b c if d!=. <br />regress a b c d </code> <br />
<br />
<b>This would be 100% correct if you used an old Stata dataset</b>; 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, <b><span style="color: red;">you would probably obtain inconsistent observation numbers</span></b>. <br />
<br />
The correct way to perform this would be to use <b>if c <.</b> or <b>if !mi(c).</b> The revised code would similar to:<br /> <br /><code>regress a b if !mi(c) & !mi(d) <br />regress a b c if !mi(d) <br />regress a b c d </code> <br />
<br />
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. <b>There are two easy ways to overcome this: </b>1) creating a dummy called “touse” with 1 representing valid values for all variables; and 0 for at least one missing value. <br />
<br />
<code>gen touse =!mi(y, a, b, c, d) <br />regress y a b if touse <br />regress y a b c if touse <br />regress y a b c d if touse </code> <br />
<br />
2) If you don’t like this approach, you can also deal with missing values by using nestreg:<br />
<br />
<code>nestreg: reg y (a b) (c) (d) </code>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-66679234889655460592009-08-04T19:47:00.001-07:002012-04-21T22:16:44.499-07:00Endnote: Inputing the name of orgnizationsToday, while I was typing a reference by <b>Society for Technology in Education</b>, the following picture appeared:<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3788977243/"><img alt="1.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2450/3788977243_ebe1438e8e.jpg" /></a><br />
<br />
That means <span style="color: red;"><b>that it was messed up!</b> <span style="color: black;">Endnote had treated it as the name of a person, but that is not what I wanted. </span></span><br />
<br />
When you type a reference written by an organization, you have to perform one additional step. You have to type "<b>,,</b>" (without quote) at the end of the name:<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3788977475/"><img alt="2.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2552/3788977475_e3232e09fd.jpg" /></a><br />
<br />
And it works!<br />
<a href="http://www.flickr.com/photos/29041369@N06/3789788172/"><img alt="3.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3488/3789788172_5eb1e3d11a.jpg" /></a><br />
<br />
Simple tips are really important!!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-87199874434529295722009-06-30T17:13:00.001-07:002012-04-21T23:35:52.133-07:00Solution: Skype uses more than 50% CPUI 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. <br />
<br />
Eventually, I found this post on the Skype forum: <a href="http://forum.skype.com/index.php?showtopic=367371&st=20" title="http://forum.skype.com/index.php?showtopic=367371&st=20">http://forum.skype.com/index.php?showtopic=367371&st=20</a><br />
<br />
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 <b>3.0.684</b>. For more detail, check here: <a href="http://kb.eset.com/esetkb/index?page=content&id=SOLN2277&cat=WINNT&actp=LIST" title="http://kb.eset.com/esetkb/index?page=content&id=SOLN2277&cat=WINNT&actp=LIST">http://kb.eset.com/esetkb/index?page=content&id=SOLN2277&cat=WINNT&actp=LIST</a><br />
<br />
<img alt="About ESET Smart Security window" height="469" src="http://kb.eset.com/library/ESET/KB%20Team%20Only/SOLN2277/ESS4-version.png" width="479" /><br />
<br />
Go to here <a href="http://www.eset.com/download/index.php" title="http://www.eset.com/download/index.php">http://www.eset.com/download/index.php</a> and download the latest version, and you may also <b>upgrade</b> to version 4. According to an ESET announcement, “<b>ESET Smart Security 4 and ESET NOD32 Antivirus 4 have arrived!</b> Existing customers with a valid license for either product may <span style="color: red;"><b>upgrade to the latest version of the same product for free!</b> </span>Simply download the latest software and install it on your computer.”Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-38198233733147098152009-06-27T11:43:00.001-07:002012-04-21T21:28:20.018-07:00ESL Assistant: Reduce your English writing errors<div class="MsoNormal">
ESL Assistant is a website developed by Microsoft with the goal of helping non-native-English speakers by identifying writing problems and suggesting improvements.</div>
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3665224263/" title="1.png"><img alt="1.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3409/3665224263_baa6a747a4.jpg" /></a><br />
<br />
ESL Assistant: <a href="http://www.eslassistant.com/" title="http://www.eslassistant.com/">http://www.eslassistant.com/</a> <br />
<br />
<div class="MsoNormal">
Paste your writing into the text area and click <i style="mso-bidi-font-style: normal;">check</i>.</div>
<a href="http://www.flickr.com/photos/29041369@N06/3666027880/" title="2.png"><img alt="2.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3413/3666027880_2e682b2564.jpg" /></a><br />
<br />
<div class="MsoNormal">
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 <span class="msoDel"><del cite="mailto:MASH" datetime="2011-06-24T14:24"></del></span>may<a href="http://www.blogger.com/post-edit.g?blogID=1529768188906126710&postID=3819823373314709815#_msocom_1"></a> check these “sample sentences” and decide whether to follow the suggestions.<br />
<br />
Keep in mind that this tool only provides suggestions, and does not necessarily identify all of your errors. In addition,<b> this tool occasionally identifies errors, which are in fact grammatically correct. </b></div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1529768188906126710.post-82229812619250167752009-06-22T11:33:00.001-07:002012-04-21T21:26:35.518-07:00EndNote X3 for Windows realeased!The new version of Endnote for windows was realeased on June 17, 2009. There are many new features:<br />
<ul>
<li><b>Format bibliographies in OpenOffice.org Writer 3</b></li>
<li><b>Group references and locate full text in new ways</b></li>
<li><b>Find More Full Text with EZProxy</b></li>
<li><b>Work on the desktop and Web</b></li>
</ul>
<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/pJdCRpjUg40&hl=zh_TW&fs=1&">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/pJdCRpjUg40&hl=zh_TW&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
Students in North America can purchase EndNote X3 for $115.95 USD with a valid student I.D.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-20032427342361613562009-06-04T19:51:00.001-07:002012-04-21T20:19:16.851-07:00Stata: Export Logistic Regression (Coefficient/Odds ratio) to Word or ExcelStata provides two commands for logistic regression: logit and logistic. Logit reports <b>coefficients;</b> whereas logistic reports <b>odds ratio</b>s. The general command for logistic regression appears like this: <br /> <br /><code>logit y x <br />logistic y x </code> <br /><br />
Logit output:<br />
<a href="http://www.flickr.com/photos/29041369@N06/3419754264/"><img alt="1.png" border="0" src="http://farm4.static.flickr.com/3407/3419754264_9f399fa7b0.jpg" /></a><br />
<br />
Logistic output:<br />
<a href="http://www.flickr.com/photos/29041369@N06/3419754328/"><img alt="2.png" border="0" src="http://farm4.static.flickr.com/3651/3419754328_473f83d023.jpg" /></a><br />
<br />
If you want to export the coefficients to Word or Excel, it is the same as exporting an OLS regression. Here is the code I used:<br />
<br />
<code>esttab * using logistic1.csv, b(3) pr2 </code> <br />
<br />
Exporting odds ratios requires transformation. The key is “eform” at the end of this command: <br /> <br /><code>esttab * using logistic2.rtf, b(3) pr2 eform</code> <br /><br />
and the results in Word look like this:<br />
<a href="http://www.flickr.com/photos/29041369@N06/3418944431/"><img alt="3.png" border="0" src="http://farm4.static.flickr.com/3574/3418944431_383dc5542e.jpg" /></a><br />
<br />
If you require t-test, you may use the following code:<br />
<br />
<code>esttab * using logistic3.csv, cells("b(fmt(3) star)" t(par fmt(2))) pr2 </code><br />
<code> </code>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-74909063101587328102009-06-01T09:46:00.001-07:002012-04-21T23:24:59.798-07:00Stata: Outputting correlation tablesThere are two ways to export correlation tables from Stata to Word or Excel. The first approach works only on Windows. You first select your correlation table and copy it. <br /> <br /><a href="http://www.flickr.com/photos/29041369@N06/3369714500/"><img alt="1.png" border="0" src="http://farm4.static.flickr.com/3565/3369714500_11930c73b6.jpg" /></a> <br /> <br /><a href="http://www.flickr.com/photos/29041369@N06/3369714678/"><img alt="2.png" border="0" src="http://farm4.static.flickr.com/3545/3369714678_f32c5aa28c.jpg" /></a> <br /> <br /><br />
You then paste it into Excel and do some editing.<br />
<a href="http://www.flickr.com/photos/29041369@N06/3369714776/"><img alt="3.png" border="0" src="http://farm4.static.flickr.com/3664/3369714776_80ca01a8d3.jpg" /></a> <br />
<br />
If you would like stars after your correlation coefficient, run a command like this: <br />
<br />
<code>pwcorr X1 X2 X3 X4, star(.05)</code> <br />
<br />
and then copy the table as mentioned above. It will look like this when you paste it into Excel <br /> <br /><a href="http://www.flickr.com/photos/29041369@N06/3369714906/"><img alt="4.png" border="0" src="http://farm4.static.flickr.com/3587/3369714906_58cf4c8830.jpg" /></a><br />
<br />
The second way is to use esttab, in which the command looks like this:<br />
<br />
<code>estpost correlate x1 x2 x3 x4, matrix listwise <br />est store c1 <br />esttab * using test_correlation.rtf, unstack not noobs compress </code>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1529768188906126710.post-55437102251470869062009-05-27T21:46:00.001-07:002012-04-21T21:43:19.098-07:00Stata: Export OLS regression table to Word or ExcelStata is a statistics software package with many neat modules that can help you to reduce your workload. One of my favorite modules is estout, which allows the export of your regression tables directly from Stata to Word documents or Excel. Isn’t that cool?<br />
<br />
Website:<a href="http://repec.org/bocode/e/estout/installation.html">http://repec.org/bocode/e/estout/installation.html</a><br />
<br />
1. First, install this great module by typing the following command in Stata:<br />
<code>ssc install estout, replace</code><br />
<br />
2. Run one OLS regression (the program can export many regression tables, but for now, we will limit ourselves to one).<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3295794345/"><img alt="1.png" border="0" src="http://farm4.static.flickr.com/3493/3295794345_ed9e98d0b5.jpg" /></a><br />
<br />
3. When you are done, type the following:<br />
<br />
<code>esttab using test.rtf</code> <br />
<br />
4. You can find this file in my document\stata folder. It appears ike this:<br />
<a href="http://www.flickr.com/photos/29041369@N06/3295794511/"><img alt="2.png" border="0" src="http://farm4.static.flickr.com/3594/3295794511_e4de4495b5.jpg" /></a><br />
5. If you are using have hierarchical regression/ nested regression, things can become a bit complicated. You have to store it by typing est store m1 after running your first regression. It would be look like this:<br />
<br />
<code>regress y x1 x2 <br />est store m1 <br />regress y x1 x2 x3 x4 <br />est store m2 <br />regress y x1 x2 x3 x4 x5 x6 <br />est store m3 <br />esttab * using test.rtf, replace </code><br />
<code><br /></code> <br />
6. The export file would appear like this:<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3296637526/"><img alt="3.png" border="0" src="http://farm4.static.flickr.com/3591/3296637526_9332731a31.jpg" /></a><br />
<br />
7. If you would prefer the output to be in Excel format, you can use test.csv.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1529768188906126710.post-74150227499405983982009-05-22T14:49:00.001-07:002012-04-21T21:51:32.910-07:00Endnote: import BibTex formatEndnote does not have an import filter for Bibtex format. However, Zotero or Jabref can be used to convert your bibliography. If you would prefer not to install additional programs on your computer, you could also try a tool here: <a href="http://www.it.usyd.edu.au/%7Etapted/bib2endnote.html" title="http://www.it.usyd.edu.au/~tapted/bib2endnote.html">http://www.it.usyd.edu.au/~tapted/bib2endnote.html</a> This tool is capable of converting Endnote generated xml format from Bibtex. We have provided a syntax Bibtex file with which to practice: <a href="http://people.umass.edu/kbj/homepage/index_johnson.htm" title="http://people.umass.edu/kbj/homepage/index_johnson.htm">http://people.umass.edu/kbj/homepage/index_johnson.htm</a> <br /> <br />Download bib2endnote.jar from the first website mentioned above. Ensure that you have Java Virtual Machine installed, run this tool, and open your bib file.<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3555285102/" title="1.png"><img alt="1.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2435/3555285102_42178aab07.jpg" /></a><br />
<br />
Be patient. It may require several minutes before you see the file in xml format in the right panel. Remember to save it.<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3555285260/" title="2.png"><img alt="2.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3628/3555285260_343a60174d.jpg" /></a> <br /> <br />Run Endnote and begin the import.<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3554482341/" title="3.png"><img alt="3.png" border="0" hspace="0" src="http://farm4.static.flickr.com/3328/3554482341_fabb4d5741.jpg" /></a><br />
<br />
Select your xml file, and remember to choose <b>Endnote generated XML</b> format under import option.<br />
<br />
<a href="http://www.flickr.com/photos/29041369@N06/3554482481/" title="4.png"><img alt="4.png" border="0" hspace="0" src="http://farm3.static.flickr.com/2438/3554482481_92744edb13.jpg" /></a><br />
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:457f99e9-9a48-4dac-b142-3def0ab2a371" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Technorati Tags:<a href="http://technorati.com/tags/bibliography" rel="tag">bibliography</a>,<a href="http://technorati.com/tags/endnote" rel="tag">endnote</a>,<a href="http://technorati.com/tags/bibtex" rel="tag">bibtex</a>,<a href="http://technorati.com/tags/reference" rel="tag">reference</a></div>Unknownnoreply@blogger.com0