<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michael Ewens &#187; stata</title>
	<atom:link href="http://michaelewens.com/tag/stata/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelewens.com</link>
	<description>Tepper School of Business, Carnegie Mellon Univ.</description>
	<lastBuildDate>Tue, 10 Jan 2012 19:00:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stata, ODBC and date columns</title>
		<link>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/</link>
		<comments>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/#comments</comments>
		<pubDate>Sun, 23 May 2010 06:32:13 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ado]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=648</guid>
		<description><![CDATA[Stata has a ton of flexilbility for creating and manipulating dates. However, if you want to save Stata data to an external database (e.g. Accesss, PostgreSQL, MySQL, etc.) the numeric date format in Stata will be difficult to interpret outside the program. My use case involved working with Stata to merge and clean some data [...]]]></description>
			<content:encoded><![CDATA[<p>Stata has a ton of flexilbility for <a href="http://www.stata.com/help.cgi?dates_and_times">creating and manipulating dates</a>.  However, if you want to save Stata data to an external database (e.g. Accesss, PostgreSQL, <a href="http://www.mysql.com/">MySQL</a>, etc.) the numeric date format in Stata will be difficult to interpret outside the program.  My use case involved working with Stata to merge and clean some data that was pushed to a MySQL database with <a href="http://www.stata.com/help.cgi?odbc">odbc</a> and later loaded in <a href="http://www.r-project.org/">R</a> with its <a href="http://cran.r-project.org/web/packages/RODBC/index.html">odbc functionality</a>.  It was in the last step that I learned of Stata&#8217;s dating conventions when writing to external databases.  So <a href="http://www.stata.com/statalist/archive/2010-05/msg01190.html">I asked the Stata list</a>.</p>
<p>A <a href="http://www.stata.com/statalist/archive/2010-05/msg01201.html">very helpful subsciber</a> presented a solution very similar to one that I mocked up.  With some of the code posted on the Statalist and some new additions, I present <a href="http://pastebin.com/8ywbft1S">odbc2create</a>. UPDATE: I fixed an issue when dealing with a database with no dates and had to add a loop.</p>
<p>This modified odbc command does the following:</p>
<ul>
<li>searches all your variables for dates (they must be formatted as such or Stata&#8217;s ability to detect them is impossible)</li>
<li>converts those dates to the YYYY-MM-DD format</li>
<li>inserts the dates into your mysql database as strings</li>
<li>re-types those date columns in the newly created database as DATEs</li>
</ul>
<p>The best part: when you load a table created this way back into Stata, it immediately recognized the DATEs as dates.  I hope they build this functionality into Stata in the future.  One caveat (which may explain why they haven&#8217;t built it internally) is that the ALTER command in the ado file is specific to MySQL.  Someone should generalize the code to recognize the datasource engine and modify the ALTER command accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Latex regression and summary tables in Stata</title>
		<link>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/</link>
		<comments>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 18:17:17 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[eststo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[regressions]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=630</guid>
		<description><![CDATA[A clean, well organized latex table is difficult to build. If you do a lot of analysis in Stata, there are several tools to output latex tables of your regressions or summary statistics. These packages do not always work perfectly with the standard options. Below I present two example code snippets to produce a latex [...]]]></description>
			<content:encoded><![CDATA[<p>A clean, well organized latex table is difficult to build.  If you do a lot of analysis in Stata, there are several tools to output latex tables of your regressions or summary statistics.  These packages do not always work perfectly with the standard options.  Below I present two example code snippets to produce a latex table of a set of regressions that includes a IV estimator and a summary statistics table that compares two groups in a database.  Each uses the <a href="http://repec.org/bocode/e/estout/">eststo package</a>.</p>
<p><strong>Regression Table with Multiple Equations and Stages</strong></p>
<p>Here I run a couple of limited dependent variable models and a two-stage bivariate probit with an IV.  The output isn&#8217;t perfect, but it works for pre-submission distribution.</p>
<p><script src="http://gist.github.com/361415.js"></script></p>
<p>The output looks like this:</p>
<p><a title="View Latex regression output from eststo on Scribd" href="http://www.scribd.com/doc/29669150/Latex-regression-output-from-eststo" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Latex regression output from eststo</a> <object id="doc_787590025690274" name="doc_787590025690274" height="500" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" rel="media:document" resource="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list"><embed id="doc_787590025690274" name="doc_787590025690274" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="500" width="100%" wmode="opaque" bgcolor="#ffffff"></embed></object>	</p>
<p><strong>Summary statistics with a by variable</strong></p>
<p>Next, consider summarizing the characteristics of two groups in your data.  For example, I want to compare the age, number of boards seats and other features of venture capital spinoff founders to everyone else.  </p>
<p><script src="http://gist.github.com/361423.js"></script></p>
<p>The output will look like this:</p>
<p><a title="View Found on Scribd" href="http://www.scribd.com/doc/29669266/Found" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Found</a> <object id="doc_596590822087790" name="doc_596590822087790" height="500" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" rel="media:document" resource="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list"><embed id="doc_596590822087790" name="doc_596590822087790" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="500" width="100%" wmode="opaque" bgcolor="#ffffff"></embed></object>	</p>
<p>The full details of the <a href="http://repec.org/bocode/e/estout/hlp_esttab.html">esttab</a>, <a href="http://repec.org/bocode/e/estout/hlp_estpost.html">estpost</a> and <a href="http://repec.org/bocode/e/estout/hlp_eststo.html">eststo</a> have many more options and a lot of <a href="http://repec.org/bocode/e/estout/advanced.html">examples</a>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running sums in Stata</title>
		<link>http://michaelewens.com/2010/02/21/running-sums-in-stata/</link>
		<comments>http://michaelewens.com/2010/02/21/running-sums-in-stata/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 19:36:05 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=610</guid>
		<description><![CDATA[Perhaps it is bad that I didn&#8217;t know this before, but the following code for Stata would have saved a week off of my dissertation work.  Suppose that you have data structured like so: firm_id,date,amount and you want to create a new variable that is the total amount as of each date for each firm. [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps it is bad that I didn&#8217;t know this before, but the following code for Stata would have saved a week off of my dissertation work.  Suppose that you have data structured like so:</p>
<p><code>firm_id,date,amount</code></p>
<p>and you want to create a new variable that is the total amount as of each date for each firm.  In Stata, you simply type:</p>
<p><code>sort firm_id date</code><br />
<code>bysort firm_id: gen total_t = sum(amount)</code></p>
<p>Note the use of &#8216;<a href="http://www.stata.com/help.cgi?Generate">gen</a>&#8216; rather than &#8216;<em><a href="http://www.stata.com/help.cgi?egen">egen</a></em>.&#8217; The &#8216;sum&#8217; command differs by the type of generate command (i.e. gen or egen), so about 500 lines of loops written in Stata code could be condensed in a few lines.  Stata needs to fix the &#8216;egen&#8217; and &#8216;gen&#8217; distinction or I need to port more of my projects to R.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/02/21/running-sums-in-stata/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stata ODBC and Mysql collations</title>
		<link>http://michaelewens.com/2009/06/09/stata-odbc-and-mysql-collations/</link>
		<comments>http://michaelewens.com/2009/06/09/stata-odbc-and-mysql-collations/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 21:47:00 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/2009/06/09/stata-odbc-and-mysql-collations/</guid>
		<description><![CDATA[What I learned today Make sure that you set your column collations to latin1_swedish_c if you want to load a mysql table not created by Stata.]]></description>
			<content:encoded><![CDATA[<p><b>What I learned today</b></p>
<p>Make sure that you set your column collations to <i>latin1_swedish_c</i> if you want to load a mysql table not created by Stata.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/06/09/stata-odbc-and-mysql-collations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a lagged sum variable in Stata</title>
		<link>http://michaelewens.com/2009/05/19/create-a-lagged-sum-variable-in-stata/</link>
		<comments>http://michaelewens.com/2009/05/19/create-a-lagged-sum-variable-in-stata/#comments</comments>
		<pubDate>Tue, 19 May 2009 09:03:11 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[lag operators]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=367</guid>
		<description><![CDATA[UPDATE: this code is stupid. You can do this in a few lines. Although Stata has powerful lag operators for both time series and panel settings, it is difficult to construct lagged sums of variables across an unbalanced panel.  Suppose you have observations for individuals.   Each time period you observe some value like investments, [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: this code is stupid.  <a href="http://michaelewens.com/2010/02/21/running-sums-in-stata/">You can do this in a few lines</a>.</p>
<p>Although <a href="http://www.stata.com/help.cgi?tsvarlist">Stata has powerful lag operators</a> for both time series and panel settings, it is difficult to construct lagged sums of variables across an unbalanced panel.  Suppose you have <img src='http://s.wordpress.com/latex.php?latex=T_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='T_i' title='T_i' class='latex' /> observations for <img src='http://s.wordpress.com/latex.php?latex=i%3D1%2C%5Cldots%2CN&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='i=1,\ldots,N' title='i=1,\ldots,N' class='latex' /> individuals.   Each time period you observe some value like investments, hours worked, etc.   The example I discuss below simply counts the number of times an event has occurred up to time <img src='http://s.wordpress.com/latex.php?latex=t&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='t' title='t' class='latex' /> for each observation.  Here an event is &#8220;IPO&#8221; where I need the total number of IPOs prior to $latex  t$.  First, I  construct an indicator for the event and generate a simple date variable that ignores the unbalanced nature of the dataset:</p>
<p><code>gen ipo = (outcome == "IPO")<br />
sort panelid datevar<br />
bysort panelid: gen date = _n<br />
sum date<br />
local total = r(max)<br />
keep panelid date ipo</code></p>
<p>I save this as a temporary dataset for the unfortunate for loop:</p>
<p><code>save temp, replace</code></p>
<p>and reshape for lagged summing:</p>
<p><code>reshape wide ipo, i(panelid) j(date)</code></p>
<p>The following for loop exploits the wide nature of the reshaped data and computes a sum of the IPO variable as of date <img src='http://s.wordpress.com/latex.php?latex=t&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='t' title='t' class='latex' />:</p>
<p><code>forvalues x = 2(1)`total'{<br />
if(`x'==2){<br />
gen total_ipo2 = ipo1<br />
}<br />
else {<br />
local minx = `x'-1<br />
gen total_ipo`x' = total_ipo`minx' + ipo`minx'<br />
}<br />
}</code></p>
<p>Now have to reshape back</p>
<p><code>drop ipo1-ipo`total'<br />
reshape long total_ipo, i(panelid) j(date)<br />
drop if total_ipo == .<br />
sort panelid date</code></p>
<p>The sums in the for loop above generate one too many observations at the end of each observations time series that we need to drop:</p>
<p><code>bysort panelid: gen n = _n<br />
bysort panelid: gen nn = _N<br />
drop if n == nn<br />
drop n nn<br />
keep panelid date total_*<br />
sort panelid date</code></p>
<p>And it is done.  I am sure that there is a more elegant solution&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/05/19/create-a-lagged-sum-variable-in-stata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plot multiple kernel densities on one plot in Stata</title>
		<link>http://michaelewens.com/2009/03/23/plot-multiple-kernel-densities-on-one-plot-in-stata/</link>
		<comments>http://michaelewens.com/2009/03/23/plot-multiple-kernel-densities-on-one-plot-in-stata/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:35:07 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[plotting]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=167</guid>
		<description><![CDATA[If you want to compare kernel density estimates across years for a particular variable, putting each estimate on one graph will make it easy. The process is fairly straightforward in Stata (and even easier in Matlab…). First, we start with the simple ‘kdensity‘ command kdensity income if year == 1990 Next, we append this command [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to compare kernel density estimates across years for a particular variable, putting each estimate on one graph will make it easy. The process is fairly straightforward in Stata (and even easier in Matlab…). First, we start with the simple ‘kdensity‘ command</p>
<p><code>kdensity income if year == 1990<br />
</code><br />
Next, we append this command with the ‘addplot‘ function:</p>
<p><code>kdensity income if year == 1990, addplot(kdensity income if year == 1991)<br />
</code><br />
and we can add even more with the ‘||’ syntax:</p>
<p><code>kdensity income if year == 1990, addplot(kdensity income if year == 1991 || kdensity income if year == 1992)</code></p>
<p>If we could use the ‘by’ option, this process would be much cleaner. Finally, we add a legend:</p>
<p><code>kdensity income if year == 1990, addplot(kdensity income if year == 1991 || kdensity income if year == 1992) legend(ring(0) pos(2) label(1 "1990") label(2 "1991") label(3 "1992"))</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/03/23/plot-multiple-kernel-densities-on-one-plot-in-stata/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Strings to unique integers in Stata</title>
		<link>http://michaelewens.com/2009/03/22/strings-to-unique-integers-in-stata/</link>
		<comments>http://michaelewens.com/2009/03/22/strings-to-unique-integers-in-stata/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 08:33:03 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=165</guid>
		<description><![CDATA[Suppose you have a string variable with a finite number of values (e.g. US states, industry, etc). The encode command plus the generate command will create a new variable that assigns unique ids to each string value: encode your_string_variable, gen(new_string_as_int) The labels in the edit/browse view will look like strings, so make sure you use [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a string variable with a finite number of values (e.g. US states, industry, etc).  The encode command plus the generate command will create a new variable that assigns unique ids to each string value:</p>
<p><code>encode your_string_variable, gen(new_string_as_int) </code></p>
<p>The labels in the edit/browse view will look like strings, so make sure you use ‘nolabel’ on any export or tab commands.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/03/22/strings-to-unique-integers-in-stata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Dates With CRSP Data in Stata</title>
		<link>http://michaelewens.com/2009/03/21/clean-dates-with-crsp-data-in-stata/</link>
		<comments>http://michaelewens.com/2009/03/21/clean-dates-with-crsp-data-in-stata/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 08:30:31 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[crsp]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=163</guid>
		<description><![CDATA[Here is some simple code to transform those pesky CRSP dates (YYYYMMDD) to Stata compatible dates: insheet using "sp_daily.csv" rename caldt date * Date Transformation gen year = floor(date/10000) gen month = floor((date - year*10000)/100) gen day = floor(date - year*10000 - 100*month) * replace the date replace date = mdy(month, day, year) format date [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some simple code to transform those pesky CRSP dates (YYYYMMDD) to Stata compatible dates:<br />
<code>insheet using "sp_daily.csv"<br />
rename caldt date<br />
* Date Transformation gen year = floor(date/10000)<br />
 gen month = floor((date - year*10000)/100)<br />
 gen day = floor(date - year*10000 - 100*month)<br />
 * replace the date<br />
 replace date = mdy(month, day, year)<br />
format date %td</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/03/21/clean-dates-with-crsp-data-in-stata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stata to Mysql: Escaping Quotes</title>
		<link>http://michaelewens.com/2009/03/16/stata-to-mysql-escaping-quotes/</link>
		<comments>http://michaelewens.com/2009/03/16/stata-to-mysql-escaping-quotes/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 23:40:48 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[economics]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=120</guid>
		<description><![CDATA[If you use multiple linked databases or tables, I highly recommend linking mysql and Stata for both data merging and analysis. You can store the data in one clean place with relational tables and have all of Stata&#8217;s capabilities at hand with the odbc command. Before you start running &#8220;odbc insert&#8221; commands, you have to [...]]]></description>
			<content:encoded><![CDATA[<p>If you use multiple linked databases or tables, I highly recommend linking mysql and Stata for both data merging and analysis.  You can store the data in one clean place with relational tables and have all of Stata&#8217;s capabilities at hand with the <a href="http://www.stata.com/help.cgi?odbc">odbc command</a>.  Before you start running &#8220;odbc insert&#8221; commands, you have to make sure the data is compatible with SQL queries.  This means all strings need the quotes escaped.  I was doing so many of these escapes that I wrote an ado file to simplify the process.</p>
<p><a href='http://michaelewens.com/wp-content/uploads/2009/03/escape_all_quotes.ado'>Download: escape_all_quotes</a></p>
<p>The script loops through all the variables in your dataset, checks if each is a string and if so, escapes any quotes.  Although it has worked for 1000s of my &#8220;odbc insert&#8221;s, their could be bugs or speed improvements.  Let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/03/16/stata-to-mysql-escaping-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

