<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Guanhua Lu's Web Notes</title>
	<atom:link href="http://guanhualu.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://guanhualu.wordpress.com</link>
	<description>Something to remember</description>
	<lastBuildDate>Wed, 28 Oct 2009 15:33:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='guanhualu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Guanhua Lu's Web Notes</title>
		<link>http://guanhualu.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://guanhualu.wordpress.com/osd.xml" title="Guanhua Lu&#039;s Web Notes" />
	<atom:link rel='hub' href='http://guanhualu.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Log Transformation, Additive and Multiplicative</title>
		<link>http://guanhualu.wordpress.com/2009/10/28/log-transformation-additive-and-multiplicative/</link>
		<comments>http://guanhualu.wordpress.com/2009/10/28/log-transformation-additive-and-multiplicative/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 15:33:30 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[Additive Model]]></category>
		<category><![CDATA[Log Transformation]]></category>
		<category><![CDATA[Nultiplicative Model]]></category>
		<category><![CDATA[PROC GENMOD]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=81</guid>
		<description><![CDATA[For Left skewed data, the most popular way to handle it is to apply log transformation and then do some bias adjustment. The log transformation transforms skewed data to normal-like data. But it also trnasforms additive model (linear) to multiplicative model. At some time, we need to apply log transformation, meanwhile we prefer the additive form instead [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=81&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For Left skewed data, the most popular way to handle it is to apply log transformation and then do some bias adjustment. The log transformation transforms skewed data to normal-like data. But it also trnasforms additive model (linear) to multiplicative model. At some time, we need to apply log transformation, meanwhile we prefer the additive form instead of multiplicative. Generalized Linear Model with self-determined deviance and link function is a good choice. The following is an example by using PROC GENMOD.</p>
<p>proc genmod data=model_data2;<br />
  where origdte1 &gt; &#8220;&amp;cutoff_dt&#8221;d or mtm_sale1 = .;<br />
  class tract<br />
        no_bath<br />
        prior_qtr<br />
        curr_qtr<br />
        /param=GLM;<br />
  mu = _MEAN_;<br />
  y = _RESP_;<br />
  d = ( y &#8211; mu )**2;<br />
  variance var = mu;<br />
  **variance var = mu**2;<br />
  deviance dev = d; <br />
  fwdlink link = exp(_MEAN_);<br />
  invlink ilink = log(_XBETA_);<br />
  model log_sale = mtm_sale2*prior_qtr<br />
                assd_total<br />
                no_bath<br />
                sf_total_1 &#8211; sf_total_3<br />
                lot_size_1 &#8211; lot_size_3<br />
                bldg_age_1 &#8211; bldg_age_3                  <br />
                tract<br />
                curr_qtr<br />
                / NOINT<br />
                ;<br />
  output out=mydata.hybrid_norm_log_out p=pred;<br />
quit;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=81&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/10/28/log-transformation-additive-and-multiplicative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Missing Values in R</title>
		<link>http://guanhualu.wordpress.com/2009/10/07/missing-values-in-r/</link>
		<comments>http://guanhualu.wordpress.com/2009/10/07/missing-values-in-r/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:34:07 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=78</guid>
		<description><![CDATA[Refer: http://web.nps.navy.mil/~buttrey/S/missings.html   Missing Values A missing value is one whose value is unknown. Missing values are represented in S+ and R by the NA symbol. NA is a special value whose properties are different from other values. NA is one of the very few reserved words in S-Plus: you cannot give anything this name. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=78&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h4>Refer: <a href="http://web.nps.navy.mil/~buttrey/S/missings.html">http://web.nps.navy.mil/~buttrey/S/missings.html</a></h4>
<p> </p>
<h4>Missing Values</h4>
<p>A missing value is one whose value is unknown. Missing values are represented in S+ and R by the <tt>NA</tt> symbol. <tt>NA</tt> is a special value whose properties are different from other values. <tt>NA</tt> is one of the very few reserved words in S-Plus: you cannot give anything this name. (Because S-Plus is case-sensitive, <tt>na</tt> and <tt>Na</tt> are okay to use, although I don&#8217;t recommend them.) Missing values are often legitimate: values really are missing in real life. <tt>NA</tt>s can arise when you read in a Excel spreadsheet with empty cells, for example. You will also see <tt>NA</tt> when you try certain operations that are illegal or don&#8217;t make sense. Here are some examples of operations that produce <tt>NA</tt>&#8216;s.</p>
<pre>&gt; var (8)                                  # Variance of one number
[1] NA
&gt; as.numeric (c("1", "2", "three", "4"))   # Illegal conversion
[1]  1  2 NA  4
Warning messages:
    1 missing values generated coercing from character to numeric...
&gt; c(1, 2, 3)[4]                            # Vector subscript out of range
[1] NA
&gt; NA - 1                                   # Most operations on NAs produce NAs
[1] NA

&gt; a &lt;- data.frame (a = 1:3, b = 2:4)
&gt; a[4,]                                    # Data frame row subscript out of range
  a  b
 NA NA
&gt; a["4",]                                  # Same thing but specifying non-existent row name: note that
    a  b                                   # the row name appears
NA NA NA
#
# Here's one that's particularly irksome
#
&gt; a[1,2] &lt;- NA                             # Suppose you have an NA in your dataframe...
&gt; a[a$b &lt; 4,]                              # ...and you try to index on that column
    a  b
NA NA NA                                   # You get one of these NA rows for each NA in that column.
 2  2  3</pre>
<p>Note that if you specify a row number out of range for a <em>data frame</em>, that&#8217;s not an error. You just get a row full of <tt>NA</tt>s. Interestingly, if you specify a row index of a <em>matrix </em>that&#8217;s too big, you get a different respose altogether. That <em>is</em> an error. It&#8217;s also an error to specify too big an index for a column of either a matrix or a data frame.</p>
<h4>Operations on Missing Values</h4>
<p>Almost every operation performed on an <tt>NA</tt> produces an <tt>NA</tt>. For example:</p>
<pre>&gt; x &lt;- c(1, 2, NA, 4)                      # Set up a numeric vector
&gt; x                                        # There's an NA in there
[1]  1  2 NA  4
&gt; x + 1                                    # NA + 1 = NA
[1]  2  3 NA  5
&gt; sum(x)                                   # This produces NA because we can't add NAs
[1] NA
&gt; length(x)                                # This is okay
[1] 4</pre>
<p>By the way, the default mode of <tt>NA</tt> is logical. That generally won&#8217;t affect us.</p>
<h4>Detecting NAs</h4>
<p>You can&#8217;t find missing values by looking at <tt>x == NA</tt>. Like most other functions, the <tt>==</tt> operator returns <tt>NA</tt> when either argument is <tt>NA</tt>. The <tt>is.na()</tt> function will find missing values for you: this function returns a logical vector the same length as its argument, with <tt>T</tt> for missing values and <tt>F</tt> for non-missings. It&#8217;s fairly common to want to know the index of the missing values, and the <tt>which.na()</tt> function will do this for you. For example:</p>
<pre>&gt; x                # Here's my vector
[1]  1  2 NA  4
&gt; is.na(x)         # Is it NA?
[1] F F T F        # Answer: no, no, yes, no.
&gt; which.na (x)     # Which one is NA?
[1] 3              # Answer: the third one</pre>
<p>To find the location of <tt>NA</tt>s in a data frame, try this:</p>
<pre>&gt; unique (unlist (lapply (your.data.frame, which.na)))</pre>
<p><tt>lapply()</tt> applies the <tt>which.na()</tt> function to each column and returns a list whose i-th element is a vector containing the indices of the elements which have missing values in column i. <tt>unlist()</tt> turns that into a vector and <tt>unique()</tt> gets rid of the duplicates. To learn more about <tt>lapply()</tt>, see <a href="http://guanhualu.wordpress.com/wp-admin/apply.html">the apply family of functions</a>.</p>
<h4>Ways to Exclude Missing Values (Command Line)</h4>
<p>Math functions generally have a way to exclude missing values in their calculations. <tt>mean</tt>, <tt>mean</tt>, <tt>colVars</tt>, <tt>stdev</tt>, <tt>min</tt> and <tt>max</tt> all take the <tt>na.rm</tt> argument. When this is <tt>TRUE</tt>, missing values are omitted. The default is <tt>FALSE</tt>, meaning that each of these functions returns <tt>NA</tt> Note that <tt>var</tt> doesn&#8217;t work that way: with <tt>var</tt>, you need to supply <tt>na.method="omit"</tt>. This is to permit more complicated handling of missing values than simply omitting them.</p>
<p>S-Plus&#8217;s modeling functions accept an <tt>na.action</tt> argument that tells the function what to do when it encounters an <tt>NA</tt>. This causes the modeling function to call one of the <em>missing value filter</em> functions. These functions replace the original data set by a new data set in which the NAs have been altered. The exception is the default, <tt>na.action=na.fail</tt>, which just stops when it encounters any missing values. This is useful if you didn&#8217;t know you had any. the filter functions are:</p>
<ul>
<li><tt>na.fail</tt>: Stop if any missing values are encountered</li>
<li><tt>na.omit</tt>: Drop out any rows with missing values anywhere in them and forgets them forever.</li>
<li><tt>na.exclude</tt>: Drop out rows with missing values, but keeps track of where they were. This is the usual choice for modeling.</li>
<li><tt>na.include</tt>: For factors, creates a new level called &#8220;NA&#8221; and assigns all missing values to that class. Has no effect on continuous variables.</li>
<li><tt>na.tree.replace</tt>: Acts like <tt>na.action=na.include</tt>, only fails on continuous variables.</li>
<li><tt>na.tree.replace.all</tt>: Acts like <tt>na.action=na.include</tt>, only quantizes continuous variables, producing four discrete levels, and then adds a new level called &#8220;NA&#8221; and assigns missing values to that class.</li>
<li><tt>na.gam.replace</tt>: Operates on numeric vectors by replacing <tt>NA</tt>s by the mean of the non-missing entries. Acts like <tt>na.include()</tt> on categorical predictors.</li>
</ul>
<p>Here are examples of these functions at work. You can call them directly, as I will do here, but they are also commonly used as values for the <tt>na.action=</tt> argument to the modeling functions.</p>
<pre>#
# Set up a data frame, make a couple of elements NA.
#
&gt; a &lt;- data.frame (c1 = 1:8, c2 = factor (c("a", "b", "a", "c", "b", "c", "a", "b")))
&gt; a[4,1] &lt;- a[6,2] &lt;- NA    # This repeated assignment is legal and does what you expect.
&gt; a
  c1 c2
1  1  a
2  2  b
3  3  a
4 NA  c
5  5  b
6  6 NA
7  7  a
8  8  b
&gt; levels(a$c2)              # Note the levels of c2 are "a," "b" and "c."
[1] "a" "b" "c"

&gt; na.fail (a)               # Fails if NAs are present
Problem in na.fail.data.frame(a): missing values not allowed: found in c1, c2 

&gt; na.exclude (a)            # Omits rows with NAs in them
  c1 c2
1  1  a
2  2  b
3  3  a
5  5  b
7  7  a
8  8  b

&gt; na.include(a)              # Adds a new level to categorical predictors
  c1 c2
1  1  a
2  2  b
3  3  a
4 NA  c
5  5  b
6  6 NA
7  7  a
8  8  b
&gt; levels (na.include(a)$c2)  # There's now a fourth level in that column
[1] "a"  "b"  "c"  "NA"

&gt; na.tree.replace.all (a)    # quantizes continuous predictors into four groups
             c1 c2
1 0.0+ thru 2.5  a
2 0.0+ thru 2.5  b
3 2.5+ thru 5.0  a
4            NA  c
5 2.5+ thru 5.0  b
6 5.0+ thru 6.5 NA
7 6.5+ thru 8.0  a
8 6.5+ thru 8.0  b
&gt; levels(na.tree.replace.all (a)$c2) # Also adds an NA level
[1] "a"  "b"  "c"  "NA"

&gt; na.gam.replace (a)         # Continuous predictors have NAs replaced by others.
        c1 c2                # The mean of 1, 2, 3, 5, 6, 7, and 8 is 4 4/7.
1 1.000000  a
2 2.000000  b
3 3.000000  a
4 4.571429  c
5 5.000000  b
6 6.000000 NA
7 7.000000  a
8 8.000000  b
&gt; levels (na.gam.replace (a)$c2) # Level added, this time at the front!
[1] "NA" "a"  "b"  "c"</pre>
<h4>Ways to Exclude Missing Values (GUI)</h4>
<p>The Data | Restructure | Pack dialog acts like na.omit(). Every row with at least one <tt>NA</tt> is deleted. This operates on your data, not on a copy, so beware. You can also exclude missing values within any one column using Data | Recode.</p>
<h4>Above and Beyond: Multiple Imputation and Other Fancy Stuff</h4>
<p>S-Plus ships with a special library of missing value-handling functions. If you&#8217;re interested start with the documentation under Help | On-line Manuals | Missing Data Analysis Library. The library itself is attached with the command <tt>library (missing)</tt> or File | Load Library, then pick &#8220;missing.&#8221;</p>
<h4>Special Case 1a: Missing Values in Factor Vectors (Command line)</h4>
<p>Missing values in factor variables are generally handled with na.include(). An example is given in the <a href="http://guanhualu.wordpress.com/wp-admin/factors.html#Missing">factor variables</a> document.</p>
<h4>Special Case 1b: Missing Values in Factor Vectors (Command line)</h4>
<p>You can use Data | Recode to recode missing values. It looks weird, but if you type &#8220;change from NA to NA&#8221;, or if you type NA in the spreadsheet interface, you create a new level called &#8220;NA.&#8221; However you can only use Recode on one column at a time. If you try to Recode columns, then this doesn&#8217;t seem to work.</p>
<h4>Special Case 2: Missing Values in Character Vectors</h4>
<p><strong>Character vectors never have missing values.</strong> If you convert a non-numeric vector that includes <tt>NA</tt>s to character, the <tt>NA</tt>s will turn into the character string <tt>"NA"</tt>, a perfectly good character string. Here&#8217;s an example of when this might comes up. Suppose you have a file of numeric Zip codes. You want to make sure that these all look alike. Unfortunately, they&#8217;re given to you as numeric, which means that some have 5 digits, some have 9, some have 8 (they were nine-digit codes but they started with 0, and since they&#8217;re numeric that 0 was removed by S-Plus) or 7 or 4 or 3. If you use <tt>table(nchar(x))</tt> on that vector, all the <tt>NA</tt>s will be converted to the string <tt>"NA"</tt> and will be displayed as having two characters. By the way, the empty character string <tt>""</tt> is not missing, it&#8217;s just empty. This explains why you can&#8217;t always locate rows with an NA in them in a data frame by using <tt>apply (that.data.frame, 1, is.na) </tt>. (If that didn&#8217;t make sense, check out <a href="http://guanhualu.wordpress.com/wp-admin/apply.html">the apply family of functions</a>.) This function extracts a row from a database and turns it into a vector. If there were different sorts of things in the different columns, this will often mean that everything in the vector is converted to character, and the <tt>NA</tt>s are turned into the string <tt>"NA"</tt>. At the end of that operation there are no <tt>NA</tt>s.</p>
<h4>Special Case 3: NaNs</h4>
<p>In addition to <tt>NA</tt>, S-Plus has a special value NaN for &#8220;not a number.&#8221; 0/0 is an example of a calculation that will produce a <tt>NaN</tt>. <tt>NaN</tt>s print as <tt>NA</tt> and generally act the same way. In earlier versions of S-Plus they acted differently and this could cause problems. Nowadays every <tt>NaN</tt> acts like an <tt>NA</tt>. If you need it there is an <tt>is.nan()</tt> function for finding things that are <tt>NaN</tt> and not <tt>NA</tt>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=78&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/10/07/missing-values-in-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Plot Symbols in R</title>
		<link>http://guanhualu.wordpress.com/2009/10/07/plot-symbols-in-r/</link>
		<comments>http://guanhualu.wordpress.com/2009/10/07/plot-symbols-in-r/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:31:14 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=74</guid>
		<description><![CDATA[ points &#8211; pch http://rgraphics.limnology.wisc.edu/images/miscellaneous/pch.png<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=74&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> points &#8211; pch</p>
<p><a href="http://rgraphics.limnology.wisc.edu/images/miscellaneous/pch.png">http://rgraphics.limnology.wisc.edu/images/miscellaneous/pch.png</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=74&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/10/07/plot-symbols-in-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful Unix Commands</title>
		<link>http://guanhualu.wordpress.com/2009/09/29/useful-unix-commands/</link>
		<comments>http://guanhualu.wordpress.com/2009/09/29/useful-unix-commands/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:03:31 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=71</guid>
		<description><![CDATA[The ps command You can also use the Unix command ps. At the Unix prompt, enter: ps -u username Replace username with your username. You will see something like the following: PID TTY TIME COMMAND 10005 ? 3:03 a.out 15852 rb 0:01 -tcsh (tcsh) 24980 rb 0:00 sh -c /usr/local/bin/emacs /usr1/mmouse/snd.18106 24981 rb 0:02 /usr/local/bin/emacs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=71&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The ps command<br />
You can also use the Unix command ps. At the Unix prompt, enter:</p>
<p>ps -u username<br />
Replace username with your username. You will see something like the following:</p>
<p>PID TTY TIME COMMAND<br />
10005 ? 3:03 a.out<br />
15852 rb 0:01 -tcsh (tcsh)<br />
24980 rb 0:00 sh -c /usr/local/bin/emacs /usr1/mmouse/snd.18106<br />
24981 rb 0:02 /usr/local/bin/emacs /usr1/mmouse/snd.18106<br />
22311 rf 0:22 elm<br />
In this example, the &#8220;TIME&#8221; column shows that the process running Elm has used 22 CPU seconds.</p>
<p>On most Unix systems, you can use the uname command to determine which Unix system (e.g., SunOS, AIX, IRIX, Linux, Darwin) is running on your computer. On most systems, to obtain additional information about the operating system, at the Unix prompt, enter:</p>
<p>uname -a</p>
<p>To display how much disk space is free on mounted file systems in Unix, use the <code>df</code> command. At the Unix prompt, enter:</p>
<p>df</p>
<p>This is <strong>not</strong> the same as your quota; rather, this displays how much space is left on the device or devices designated. The output and capabilities of the <code>df</code> command vary depending on which variety of Unix you are using, so consult the man pages for specifics. However, typically, you can see information about all mounted file systems, including total space, used space, and free space.</p>
<p>To output information on a specific device or file system node, you may also specify the device or node, for example:</p>
<p>df /node_or_dirname</p>
<p>Replace <code>/node_or_dirname</code> with the name of your chosen file system node or mounted directory name.</p>
<p> </p>
<p> </p>
<p> </p>
<p>The following table lists the basic Unix job control commands:</p>
<p>Command Explanation Example<br />
&amp; Run the command in the background % long_cmd &amp;<br />
Ctrl-z Stop the foreground process [Ctrl-z]<br />
Stopped<br />
jobs List background processes % jobs<br />
[1] &#8211; Stopped vi<br />
[2] &#8211; big_job &amp;<br />
%n Refers to the background number n % fg %1<br />
%?str Refers to the background job containing str % fg %?ls<br />
bg Restart a stopped background process % bg<br />
[2] big_job &amp;<br />
fg Bring a background process to the foreground % fg %1<br />
kill Kill a process % kill %2<br />
~ Ctrl-z Suspend an rlogin or ssh session host2&gt;~[Ctrl-z]<br />
Stopped<br />
host1&gt;<br />
~~ Ctrl-z Suspend a second level rlogin or ssh session host3&gt;~~[Ctrl-z]<br />
Stopped<br />
host2&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=71&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/09/29/useful-unix-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Retaining the First Observation of Each BY Group</title>
		<link>http://guanhualu.wordpress.com/2009/05/13/retaining-the-first-observation-of-each-by-group/</link>
		<comments>http://guanhualu.wordpress.com/2009/05/13/retaining-the-first-observation-of-each-by-group/#comments</comments>
		<pubDate>Wed, 13 May 2009 15:56:03 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=69</guid>
		<description><![CDATA[PROC SORT with  NODUPKEY option reates an output data set that contains only the first observation of each BY group. The NODUPKEY option prevents an observation from being written to the output data set when its BY value is identical to the BY value of the last observation written to the output data set.  proc sort [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=69&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PROC SORT with  NODUPKEY option reates an output data set that contains only the first observation of each BY group. The NODUPKEY option prevents an observation from being written to the output data set when its BY value is identical to the BY value of the last observation written to the output data set. </p>
<p>proc sort data=DataName out=OutData NODUPKEY;</p>
<p>  By ByVariable_List;</p>
<p>run;</p>
<p>The EQUALS option, which is the default, must be in effect to ensure that the first observation for each BY group is the one that is retained by the NODUPKEY option. If the NOEQUALS option has been specified, then one observation for each BY group will still be retained by the NODUPKEY option, but not necessarily the first observation.</p>
<p><span class="strong"><a name="a003070933"></a><a name="a001093930"></a>NODUPRECS (or NODUP) checks for and eliminates duplicate observations. Because NODUPRECS checks only consecutive observations, some nonconsecutive duplicate observations might remain in the output data set. You can remove all duplicates with this option by sorting on all variables.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=69&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/05/13/retaining-the-first-observation-of-each-by-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Interaction between ODS and the NOPRINT Option</title>
		<link>http://guanhualu.wordpress.com/2009/05/12/interaction-between-ods-and-the-noprint-option/</link>
		<comments>http://guanhualu.wordpress.com/2009/05/12/interaction-between-ods-and-the-noprint-option/#comments</comments>
		<pubDate>Wed, 13 May 2009 03:38:54 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/?p=66</guid>
		<description><![CDATA[Most SAS/STAT procedures support a NOPRINT option that you can use when you want to create an output data set but do not want any displayed output. Typically, you use an OUTPUT statement in addition to the procedure&#8217;s NOPRINT option to create a data set and suppress displayed output. You can also use the Output [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=66&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most SAS/STAT procedures support a NOPRINT option that you can use when you want to create an output data set but do not want any displayed output. Typically, you use an OUTPUT statement in addition to the procedure&#8217;s NOPRINT option to create a data set and suppress displayed output.</p>
<p>You can also use the Output Delivery System to create output data sets by using the ODS OUTPUT statement. However, if you specify the NOPRINT option, the procedure may not send any output to the Output Delivery System. Therefore, when you want to create output data sets through ODS (using the ODS OUTPUT statement), and you want to suppress the display of all output, specify</p>
<p> </p>
<pre>   ods select none;</pre>
<p>or close the active ODS destinations by entering the command</p>
<p> </p>
<pre>   ods <span class="strongEmph"> DestinationName</span> close;</pre>
<p>where <em>DestinationName</em> is the name of the active ODS destination (for example, ODS HTML CLOSE).</p>
<p><strong>Note: </strong>The ODS statement does not instruct a procedure to generate output: instead, it specifies how the Output Delivery System should manage the table once it is created. You must ensure that the proper options are in effect. For example, the following code does not create the requested data set <span class="ssfeleven">Parms</span>.</p>
<p> </p>
<pre>   proc glm;
      ods output ParameterEstimates=Parms;
      class x;
      model y=x;
      run;
   quit;</pre>
<p>When you execute these statements, the following message is displayed in the log:</p>
<p>  <br />
   WARNING: Output &#8216;ParameterEstimates&#8217; was not created.</p>
<p>The data set <span class="ssfeleven">Parms</span> is not created because the table of parameter estimates is generated only when the SOLUTION option is specified in the MODEL statement in the GLM procedure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=66&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/05/12/interaction-between-ods-and-the-noprint-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Scope with the CALL SYMPUT Routine</title>
		<link>http://guanhualu.wordpress.com/2009/05/06/scope-with-the-call-symput-routine/</link>
		<comments>http://guanhualu.wordpress.com/2009/05/06/scope-with-the-call-symput-routine/#comments</comments>
		<pubDate>Wed, 06 May 2009 14:32:37 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[CALL SYMPUT]]></category>
		<category><![CDATA[SCOPE]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/2009/05/06/scope-with-the-call-symput-routine/</guid>
		<description><![CDATA[Example 1: Using CALL SYMPUT with Complete DATA Step and a Nonempty Local Symbol Table Consider the following example, which contains a complete DATA step with a CALL SYMPUT statement inside a macro: %macro env1(param1);    data _null_;       x = &#8216;a token&#8217;;       call symput(&#8216;myvar1&#8242;,x);    run; %mend env1; %env1(10) data temp;    y [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=63&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Example 1: Using CALL SYMPUT with Complete DATA Step and a Nonempty Local Symbol Table</p>
<p>Consider the following example, which contains a complete DATA step with a CALL SYMPUT statement inside a macro:</p>
<p>%macro env1(param1);<br />
   data _null_;<br />
      x = &#8216;a token&#8217;;<br />
      call symput(&#8216;myvar1&#8242;,x);<br />
   run;<br />
%mend env1;</p>
<p>%env1(10)</p>
<p>data temp;<br />
   y = &#8220;&amp;myvar1&#8243;;<br />
run;</p>
<p>When you submit these statements, you receive an error message:</p>
<p>WARNING:   Apparent symbolic reference MYVAR1 not resolved.</p>
<p>This message appears because the DATA step is complete within the environment of ENV1 (that is, the RUN statement is within the macro) and because the local symbol table of ENV1 is not empty (it contains parameter PARAM1). Therefore, the CALL SYMPUT routine creates MYVAR1 as a local variable for ENV1, and the value is not available to the subsequent DATA step, which expects a global macro variable.</p>
<p>To see the scopes, add a %PUT statement with the _USER_ option to the macro, and a similar statement in open code. Now invoke the macro as before:</p>
<p>%macro env1(param1);<br />
   data _null_;<br />
      x = &#8216;a token&#8217;;<br />
      call symput(&#8216;myvar1&#8242;,x);<br />
   run;<br />
 <br />
   %put ** Inside the macro: **;<br />
   %put _user_;<br />
%mend env1;</p>
<p>%env1(10)</p>
<p>%put ** In open code: **;<br />
%put _user_;</p>
<p>data temp;<br />
   y = &#8220;&amp;myvar1&#8243;;  /* ERROR &#8211; MYVAR1 is not available in open code. */<br />
run;</p>
<p>When the %PUT _USER_ statements execute, they write the following information to the SAS log:</p>
<p>** Inside the macro: **</p>
<p>ENV1    MYVAR1    a token<br />
ENV1    PARAM1    10</p>
<p>** In open code: **</p>
<p>The MYVAR1 macro variable is created by CALL SYMPUT in the local ENV1 symbol table. The %PUT _USER_ statement in open code writes nothing to the SAS log, because no global macro variables are created.</p>
<p>Example 2: Using CALL SYMPUT with an Incomplete DATA Step</p>
<p>In the macro ENV2, shown here, the DATA step is not complete within the macro because there is no RUN statement:</p>
<p>%macro env2(param2);<br />
   data _null_;<br />
      x = &#8216;a token&#8217;;<br />
      call symput(&#8216;myvar2&#8242;,x);<br />
%mend env2;</p>
<p>%env2(20)<br />
run;</p>
<p>data temp;<br />
   y=&#8221;&amp;myvar2&#8243;;<br />
run;</p>
<p>These statements execute without errors. The DATA step is complete only when SAS encounters the RUN statement (in this case, in open code). Thus, the current scope of the DATA step is the global scope. CALL SYMPUT creates MYVAR2 as a global macro variable, and the value is available to the subsequent DATA step.</p>
<p>Again, use the %PUT statement with the _USER_ option to illustrate the scopes:</p>
<p>%macro env2(param2);<br />
   data _null_;<br />
      x = &#8216;a token&#8217;;<br />
      call symput(&#8216;myvar2&#8242;,x);</p>
<p>   %put ** Inside the macro: **;<br />
   %put _user_;<br />
%mend env2;</p>
<p>%env2(20)</p>
<p>run;</p>
<p>%put ** In open code: **;<br />
%put _user_;</p>
<p>data temp;<br />
   y=&#8221;&amp;myvar2&#8243;;<br />
run;</p>
<p>When the %PUT _USER_ statement within ENV2 executes, it writes the following to the SAS log:</p>
<p>** Inside the macro: **</p>
<p>ENV2   PARAM2   20</p>
<p>The %PUT _USER_ statement in open code writes the following to the SAS log:</p>
<p>** In open code: **</p>
<p>GLOBAL   MYVAR2   a token</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=63&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/05/06/scope-with-the-call-symput-routine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Three days that shook the world</title>
		<link>http://guanhualu.wordpress.com/2009/01/15/three-days-that-shook-the-world/</link>
		<comments>http://guanhualu.wordpress.com/2009/01/15/three-days-that-shook-the-world/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:24:58 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/2009/01/15/three-days-that-shook-the-world/</guid>
		<description><![CDATA[Exactly three months ago, the collapse of Lehman triggered a global financial panic. Fortune examines what happened in the 72 hours when the world&#8217;s most powerful bankers met to try to save Lehman and wound up changing the face of Wall Street forever. By William D. Cohan Last Updated: December 16, 2008: 4:10 PM ET [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=59&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2 style="background:white;vertical-align:top;margin:0;"><span style="font-size:12pt;font-family:Arial;">Exactly three months ago, the collapse of Lehman triggered a global financial panic. Fortune examines what happened in the 72 hours when the world&#8217;s most powerful bankers met to try to save Lehman and wound up changing the face of Wall Street forever. </span></h2>
<p class="MsoNormal" style="background:white;vertical-align:top;margin:0;"><span style="font-size:8.5pt;color:#575757;font-family:Arial;">By William D. Cohan</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;margin:0;"><span style="font-size:8.5pt;text-transform:uppercase;color:#575757;font-family:Helvetica;">Last Updated: December 16, 2008: 4:10 PM ET</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;margin:0;"><span style="font-size:9pt;font-family:Arial;"><br /><!--startclickprintexclude--></span></p>
<p><!--endclickprintexclude--></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;"><!-- CONTENT --><!-- REAP --><!--startclickprintexclude-->NEW YORK (Fortune) &#8212; When the most powerful people in American capitalism convened at the New York Federal Reserve Bank&#8217;s Italianate palazzo in lower Manhattan on Friday evening, September 12, to try to save Lehman Brothers from certain death, what confronted them was nothing less than the knowledge that whatever actions they took &#8211; or did not take &#8211; that weekend could push the financial system into the abyss.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Over the next stressful 72 hours, CEOs and their top deputies from Goldman Sachs (<a href="http://money.cnn.com/quote/quote.html?symb=GS&amp;source=story_quote_link"><span style="color:#003366;">GS</span></a>, <a href="http://money.cnn.com/magazines/fortune/fortune500/2008/snapshots/10777.html?source=story_f500_link"><span style="color:#003366;">Fortune 500</span></a>), Merrill Lynch, Morgan Stanley (<a href="http://money.cnn.com/quote/quote.html?symb=MS&amp;source=story_quote_link"><span style="color:#003366;">MS</span></a>, <a href="http://money.cnn.com/magazines/fortune/fortune500/2008/snapshots/3515.html?source=story_f500_link"><span style="color:#003366;">Fortune 500</span></a>), JPMorgan Chase (<a href="http://money.cnn.com/quote/quote.html?symb=JPM&amp;source=story_quote_link"><span style="color:#003366;">JPM</span></a>, <a href="http://money.cnn.com/magazines/fortune/fortune500/2008/snapshots/2608.html?source=story_f500_link"><span style="color:#003366;">Fortune 500</span></a>), Citigroup (<a href="http://money.cnn.com/quote/quote.html?symb=C&amp;source=story_quote_link"><span style="color:#003366;">C</span></a>, <a href="http://money.cnn.com/magazines/fortune/fortune500/2008/snapshots/2927.html?source=story_f500_link"><span style="color:#003366;">Fortune 500</span></a>), Credit Suisse and other firms worked alongside Treasury Secretary Hank Paulson and Timothy Geithner, then the president of the New York Federal Reserve and now Barack Obama&#8217;s choice to replace Paulson at Treasury. Three months to the day that the bankers emerged from that fateful weekend, though, it is clear that the ideals and egos of the participants in those meetings have reordered the American business landscape.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">On Friday September 12, there were four major investment banks. Today, there are none recognizable as such. On that Friday, the Dow closed well above 11,000. Today, it is 3,000 points lower. On September 12, a form of &#8220;compassionate conservatism&#8221; was still the doctrine of the Bush administration. </span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Today, the federal government has nationalized Fannie Mae, Freddie Mac and AIG. It has bailed out banks with hundreds of billions of dollars of taxpayer money, purchased some of their most toxic assets, and no one is sure where this blurring of the lines between the public and private sector will end. By turning the clock back and looking at what transpired during that weekend, one can see how a transformation of the U.S. financial industry occurred almost in a flash, with the consequences unknown even to people in the room.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;We went into the weekend knowing it was very dark,&#8221; explained a government official. &#8220;There was nobody that was part of this process that did not believe the world was exceptionally fragile and that Lehman was systemic and that the consequences of its default would be traumatic. There was nobody in that room &#8211; from the Treasury, the Fed or from the Federal Reserve Board or from the private sector &#8211; that could have told you exactly what would happen or what the consequences would be. And I made it clear over and over and again in that room that if we didn&#8217;t solve this, everything else would be harder to deal with. Solving this was not going to make all the other problems go away but we did not feel we had the ability to insulate the markets from the broader consequences of default.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">FRIDAY EVENING SEPTEMBER 12 Paulson pulls the fire alarm</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Henry Paulson, the Treasury secretary, and Christopher Cox, the chairman of the SEC, flew up from Washington on Friday for a 6 p.m. meeting with Geithner to discuss what the plan for the weekend would be. Meanwhile, Ben Bernanke, the chairman of the Federal Reserve, stayed in Washington to coordinate a response with the leaders of other central banks around the globe. Going into the weekend, there were two potential suitors for Lehman Brothers &#8211; Bank of America and London-based Barclays. With Geithner at his side, at 6:15 p.m., Paulson stood before the assembled Wall Street CEOs and delivered a harsh message, according to a source there. &#8220;There will be no bailout for Lehman,&#8221; Paulson said. &#8220;The only possible way out is a private-sector solution.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">At that moment, Ian Lowitt, Lehman&#8217;s CFO since June 2008, knew it was over for his firm. That night &#8220;[government] officials&#8230;indicated that emergency federal funding would not be forthcoming to stabilize Lehman Brothers and provide the liquidity needed for its operations,&#8221; he wrote in an affidavit accompanying the firm&#8217;s September 15 bankruptcy filing.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Unlike what the government did for Bear Stearns, in March, there would be no taxpayer money made available to support a Lehman bailout. According to one government official, there was a lot of rhetoric going into the weekend both from the Congress and from people around the Treasury about how the solution for Lehman should not involve public money. Whether that was a clever negotiating tactic or the line in the sand that would not be crossed, the Treasury secretary had set the definitive tone for the weekend. The future of Lehman Brothers, a 158-year-old firm with origins as a dry-goods store and cotton trader in Montgomery, Alabama, rested solely with the people sitting around the table in the Fed&#8217;s ornate boardroom at 33 Liberty Street. Come up with a private market plan in 48 hours to save the firm from insolvency or suffer the consequences of a catastrophic unwind of Wall Street&#8217;s complex and internecine financial relationships.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">After Paulson announced that there would be no government bailout for Lehman, he and Geithner laid out three possible contingency plans for the titans of Wall Street to work on during the weekend. Door Number One: Investigate whether there could be a &#8220;private-sector liquidation consortium&#8221; that would somehow finance a gradual sale of Lehman&#8217;s assets outside of bankruptcy. Door Number Two involved the assembled bankers closely examining Lehman&#8217;s most damaged assets and then forming a consortium to finance those that neither Bank of America nor Barclays wanted to take, allowing an acquisition of the remainder of Lehman to occur. Door Number Three was to contemplate how the free world could contain the damage in the event there was no solution possible. The first idea quickly became untenable and nobody, at the outset, had the slightest interest in seriously considering the third scenario.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The focus of the meetings became how to finance the Lehman assets that neither Bank of America (<a href="http://money.cnn.com/quote/quote.html?symb=BAC&amp;source=story_quote_link"><span style="color:#003366;">BAC</span></a>, <a href="http://money.cnn.com/magazines/fortune/fortune500/2008/snapshots/2580.html?source=story_f500_link"><span style="color:#003366;">Fortune 500</span></a>) nor Barclays (<a href="http://money.cnn.com/quote/quote.html?symb=BCS&amp;source=story_quote_link"><span style="color:#003366;">BCS</span></a>) wanted. (Representatives of Bank of America, Barclays and Lehman were in and around the Fed that weekend but were not included in many of the meetings of the wider group because of their stake in the outcome.)</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">LATE FRIDAY NIGHT Bank of America bows out</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Earlier in the week, Paulson had called Ken Lewis, the CEO of Bank of America, and asked him to take one for the team by looking seriously at buying Lehman. (Some people believe that Paulson also gave his former colleagues at Goldman Sachs an early peek at the Lehman books, too.) Representatives from Bank of America flew up from its corporate headquarters in Charlotte, North Carolina and met with Lehman bankers at the midtown offices of Sullivan &amp; Cromwell, Lehman&#8217;s legal advisors. Bank of America spent a few days reviewing Lehman&#8217;s $85 billion book of commercial and residential real-estate loans. &#8220;We figured that the $85 billion in troubled loans was at least $10 billion underwater,&#8221; Lewis told Fortune (see &#8220;<a href="http://money.cnn.com/2008/09/28/news/companies/tully_lewis.fortune/index.htm?postversion=2008092908"><span style="color:#003366;">A visit with Bank of America CEO Ken Lewis</span></a>&#8220;). He doubted the value of Lehman&#8217;s better assets &#8211; its investment-banking and asset-management businesses &#8211; would cover the $10 billion hole. He proposed to Paulson &#8211; in a late-night phone conversation &#8211; that the government take around $65 billion off Lehman&#8217;s books. Without that level of assistance, Bank of America couldn&#8217;t consider buying Lehman.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">But the Bank of America proposal was beyond what the Fed or Treasury could realistically consider given the nature of the assets Lewis wanted the Fed to finance and because it was more than twice the $29 billion secured loan the Fed had made to JPMorgan to facilitate its acquisition of Bear Stearns. When Paulson told Lewis the government wouldn&#8217;t help, Lewis put his pencil down &#8211; for the moment. He did come to New York that weekend but would never become part of the meetings at the Fed.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">SATURDAY MORNING Lehman&#8217;s books get scrubbed</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">With Bank of America out of the mix, the bankers at the New York Fed examined a proposal by Barclays, whereby the British bank would acquire all of Lehman except for the firm&#8217;s commercial real-estate asset book, which had a face value of $40 billion (before writedowns).</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The assembled bankers spent much of Saturday poring over Lehman&#8217;s commercial real-estate portfolio in hopes of finding a way to finance the $40 billion of assets that Barclays did not want to acquire. The dodgy assets left behind needed a layer of equity underneath them for the remaining entity to have any hope of viability. According to a participant in the weekend&#8217;s fevered meetings, Lehman had 2,400 real estate &#8220;positions.&#8221;<strong> </strong></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Lehman CEO Richard Fuld and Lowitt had announced on the previous Wednesday that the commercial real-estate assets would be marked down to $33 billion &#8211; from $40 billion. But, on Saturday, as mortgage-securities experts from Citigroup, Credit Suisse, Deutsche Bank and Goldman Sachs analyzed the portfolio, they quickly realized, according to one participant, &#8220;the effective marks on the assets should probably have been $12 billion lower,&#8221; or $21 billion, rather than $40 billion, almost a 50% discount to their marked value (notwithstanding the Wednesday revision). &#8220;There wasn&#8217;t a disagreement among the group about what the write-down should be,&#8221; he said.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">But there was some disagreement about the $21 billion valuation depending on whether some institutions would have to mark them to market. As a compromise, the four banks instead recommended to the other banks in the consortium that Lehman&#8217;s real-estate portfolio be valued at around $25 billion. The hole the consortium of banks had to fill was closer to $15 billion, meaning that each one would need to provide around $1 billion to finance the commercial real-estate assets left behind by Barclays in what would remain of Lehman Brothers. The banks also knew that they would have to take a write-down on their loans as the assets were sold into the market over time. But to facilitate the Barclays deal they were willing to do it. &#8220;There was a real concern that the demise of Lehman would lead to real problems for everybody else,&#8221; one banker said.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">SATURDAY AFTERNOON Thain gets busy</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">While most of Wall Street was hunkered down at the New York Federal Reserve to review Lehman&#8217;s books, Greg Fleming, the president of Merrill Lynch and a former financial institutions banker, had been urging his boss, John Thain, Merrill&#8217;s CEO, to call Ken Lewis to talk about a deal between the two firms. Fleming had grown concerned during the week as Merrill&#8217;s stock fell to $17.05 per share, from $28.50 per share. Fleming also knew that Lewis had long coveted Merrill Lynch and that Fleming&#8217;s previous boss, Stan O&#8217;Neal, had no interest in such a deal. &#8220;It&#8217;s an iconic name,&#8221; Lewis told Fortune about Merrill Lynch and the &#8220;one company&#8221; he wanted &#8220;to round out&#8221; his strategic vision for Bank of America. He said owning Merrill Lynch &#8220;would give us a major presence in investment banking as well as wealth management.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Thain, who had been at the Fed on Friday night, knew by Saturday morning that Bank of America was out of the hunt for Lehman, and he had also decided that Lehman was not going to be saved. If Lehman declared bankruptcy, he figured Merrill would be the next domino to fall. He had watched the group of bankers &#8220;pummel&#8221; Bart McDade, Lehman&#8217;s president, with questions about Lehman&#8217;s assets &#8220;and decided he did not want to be next,&#8221; according to a banker there. &#8220;It became clear to me that it would make sense to explore options for us,&#8221; Thain said in the press conference after announcing the deal.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Thain got Lewis&#8217; cell phone number from Fleming, stepped out of the meeting and called the Bank of America CEO. &#8220;We began to talk about the opportunity over the phone,&#8221; Lewis said. &#8220;Then a few hours later, we were talking about it in person.&#8221; Rumors began circulating at the New York Fed that Thain and Lewis were talking about a deal. In the interim, Lewis flew up by private jet from Charlotte to New York. They agreed to meet secretly in Bank of America corporate-owned apartment at the TimeWarner Center, at Columbus Circle. &#8220;It didn&#8217;t take but about two seconds to see the strategic implications or [the] positive implications&#8221; of the deal, Lewis said. &#8220;It was obviously a fairly short period of time, very intense and we saw a lot of each other.&#8221; Following his call to Lewis, Thain said the two men &#8220;quickly&#8221; realized &#8220;the strategic combination made a huge amount of sense, and the opportunity to put this transaction together really was [so] unique that we both decided we wanted to take the opportunity.&#8221; The code name for the deal was &#8220;Project Alpha.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">At his side as an advisor Lewis had J. Christopher Flowers, the head of his own private-equity firm that specialized in financial services. Flowers, an ex-Goldman partner, seemed to have examined the books of nearly every Wall Street firm by September 2008, including Bear Stearns and Merrill Lynch. &#8220;[Flowers] had done quite an amount of due diligence on Merrill Lynch fairly recently,&#8221; Lewis said. &#8220;It was very, very extensive. They had looked at the marks very comprehensively. This allowed us to have him and his team as an advisor, and just update the information they already had. That was one of the key ingredients to being able to do this as quickly as we did.&#8221; Flowers was very complimentary of what Thain and his team had done in terms of shedding assets including Merrill&#8217;s 25% stake in Bloomberg and a $30.6 billion portfolio of troubled, mortgage-backed securities for 22 cents on the dollar.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Lewis determined he had to move quickly to win Merrill. Not only had he wanted to own the firm for years, he also was aware that Goldman Sachs and Morgan Stanley were in the mix. Merrill had reached out to Morgan Stanley about a deal. Morgan Stanley passed quickly &#8211; reportedly because the firm decided there simply was not enough time. Separately, on Saturday morning at the Fed, representatives of Goldman Sachs reached out to former Goldman partner Peter Krause, Merrill&#8217;s newly recruited head of strategy, to see whether Merrill would consider allowing Goldman to make a 9.9% minority investment in Merrill. This set off a heated debate &#8211; according to someone who witnessed it &#8211; between Krause and Fleming about whether Merrill should pursue the Goldman deal or the Bank of America deal. For Goldman, the idea was to save a rival and to keep the fury of the looming storm at bay. &#8220;I think about it in terms of the Great Barrier Reef,&#8221; one Goldman executive said. &#8220;If you think of Bear as being an outlying piece of coral at the far eastern extremity of the reef. Then Lehman is a bit closer in and then Merrill is a bit closer. Then Morgan Stanley and Goldman Sachs are on the beach but still pretty close to the water. When you have a tsunami coming in, it&#8217;s getting to be pretty uncomfortable.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">SATURDAY NIGHT The gloves come off</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Merrill and Bank of America executives were closing in on an all-stock deal, in which Merrill shareholders would receive $29 per share in Bank of America stock, which valued Merrill at $50 billion, a 70% premium to where Merrill&#8217;s stock had closed the previous Friday. Meanwhile, back at the Fed, tempers started to flare. The assembled bankers were still wrestling with how to value the Lehman real-estate assets that Barclays wanted to leave behind. &#8220;It was a question of how much equity we needed to put up,&#8221; one banker said, &#8220;to make the Barclays deal fly.&#8221; This led to increasing tensions on all sides. At one point, late Saturday night, Gary Shedlin, a M&amp;A banker at Citigroup, faced off against his old boss, Michael Klein, who was there representing Barclays and his client, Archibald Cox Jr., who was appointed chairman of Barclays Americas in April 2008.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;How much equity do you need to raise to do the deal?&#8221; Shedlin asked Klein.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;Why is that important?&#8221; Klein shot back. &#8220;Why do you need to know that?&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;You&#8217;re making an offer for this company and we&#8217;ve got to know how you&#8217;re going to finance it,&#8221; Shedlin countered.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;We will not have to raise any incremental capital as part of this transaction,&#8221; Klein said definitively. The two men glowered at each other before turning to less confrontational matters. (Shedlin confirmed the exchange to Fortune; Klein did not respond to requests to be interviewed.)</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Bankers worked most of the night to put together a term sheet for how they would all agree to support Barclays&#8217; acquisition of most of Lehman Brothers. Some banks &#8211; such as BNP-Paribas and Bank of New York &#8211; were not so sure they wanted to participate, causing Jamie Dimon, the CEO of JPMorgan Chase to admonish them. &#8220;You&#8217;re either in the club or you&#8217;re not,&#8221; he said, according to one banker. &#8220;And if you&#8217;re not you&#8217;d better be prepared to tell the secretary why not.&#8221; Still, a deal seemed close.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">SUNDAY MORNING A flag on the play</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">On Sunday morning, the executive group re-assembled at the Fed at nine o&#8217;clock. &#8220;Everything was ready to go on Sunday morning,&#8221; one participant said. &#8220;People were happy with the term sheet, so there was a doable deal on the table.&#8221; Steve Shafran, a senior advisor to Paulson and an ex-Goldman Sachs partner, told a group of Lehman Brothers executives at the Fed that morning, &#8220;It looks like we may have the outlines of a deal around the financing.&#8221; After which, the Lehman bankers thought they had saved their firm.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The Barclays deal required the blessing of the Financial Services Authority, in London &#8211; the UK equivalent of the SEC. So Paulson spoke with his UK counterpart, Alistair Darling, the Chancellor of the Exchequer, and to the FSA. He then summoned McDade, Lehman&#8217;s president, to the New York Fed and told him at around 9:45 a.m., &#8220;Deal&#8217;s off. The FSA has turned it down.&#8221; At roughly 10 o&#8217;clock, Paulson and Geithner briefed the bankers at the Fed.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The FSA would not comment on its decision, but a number of the participants at the Fed on Sunday morning said the reasons given to them by Paulson for the FSA&#8217;s rejection ranged from &#8220;the overall size of the potential exposure that Barclays was taking on and whether Barclays was in good enough shape to do it&#8221; to the fact that the &#8220;FSA was looking for some kind of a cap to avoid U.K. contagion, and the Fed had just said, &#8216;No assistance for Lehman.&#8217; The FSA then concluded based on the amount of diligence, the risk profile, and the lack of any assistance from the U.S. that they were not going to let it proceed.&#8221; There was also the suggestion made that Barclays &#8220;wasn&#8217;t really that serious about getting FSA approval&#8221; going into the weekend knowing that there might be an opportunity to buy what it wanted from Lehman later at a lower price. (Barclays did not make its senior officials involved with the Lehman deal available for comment.)</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The Lehman team was devastated by the news. &#8220;We thought we had a trade and felt good about it and thought we were in the right place,&#8221; explained a Lehman banker, &#8220;and then to have the rug pulled out from under us after we were led to believe that the Street was there on the financing, it was just horrifying from our perspective.&#8221; The stunned Lehman team returned to their headquarters at 745 Seventh Avenue to plot its next moves.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Paulson then told the remaining bankers, according to one, &#8220;Let&#8217;s start talking about what the world will look like if Lehman goes under. Let&#8217;s focus on a solution for stabilizing the markets.&#8221; Among the people still present for Paulson&#8217;s Sunday morning speech was John Thain. After Paulson and Geithner left the executives to contemplate what they could do as a consortium to keep the world&#8217;s markets from collapsing completely, the assembled alpha males began talking about Merrill Lynch in front of Thain, as if he weren&#8217;t there. &#8220;Merrill could be the next to go,&#8221; one banker said. &#8220;And Thain wasn&#8217;t saying anything,&#8221; a participant said. &#8220;If Thain hadn&#8217;t been there that morning, the rumors really would have been flying,&#8221; Shedlin said. A few minutes later, Thain got up and left the room &#8220;and he never comes back,&#8221; one participant said. Thain and his team were focused on negotiating a deal with Bank of America. Merrill had planned to meet with Goldman on Sunday morning but by this time Merrill had stopped returning calls to Goldman Sachs.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">After Thain, Paulson and Geithner had left the New York Fed Sunday morning, the following exchange ensued, according to several sources who were there. John Mack, the CEO of Morgan Stanley, spoke up. &#8220;Maybe we should let Merrill go down too,&#8221; he said.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Aghast, JPMorgan Chase&#8217;s Dimon pointed out how shortsighted that was of Mack because Morgan Stanley might be the next firm that counterparties lost faith in. &#8220;John, if we do that, how many hours do you think it would be before Fidelity would call you up and tell you it was no longer willing to roll your paper?&#8221; Dimon&#8217;s comment quieted Mack. &#8220;We thought Mack said that because he might be buying Merrill,&#8221; Shedlin said, and wanted to buy the firm on the cheap. (Mack denied he made the comment through a spokesman. A spokesman for Dimon said Dimon did not remember having the conversation with Mack).</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The group quickly began refocusing on putting together what became an agreement that every firm in the room would continue to do business with every other firm in the room and would underwrite a multi-billion-dollar credit facility for the firms to use in an emergency in the wake of the presumed Lehman bankruptcy. &#8220;We figured all hell would break out the next day,&#8221; one banker said. &#8220;And everyone else thought so too. Everyone was then focused on netting out their derivatives positions starting right then.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">SUNDAY AFTERNOON Paulson tells Lehman where to go</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Back uptown, at Lehman, Fuld and McDade were making frantic calls to whoever would listen to their pleas for help, including Paulson, Cox and Geithner. &#8220;But it crystallized in the course of the afternoon that it didn&#8217;t look like they were going to do anything for us,&#8221; a senior Lehman official said, despite Fuld&#8217;s belief after having dinner with Paulson in April that &#8220;we have huge brand with [T]reasury.&#8221; Calls also went out to Lehman&#8217;s internal restructuring group, to Harvey Miller, the lead bankruptcy counsel at the New York law firm Weil, Gotshal &amp; Manges and to Barry Ridings, a vice-chairman of Lazard and a restructuring expert, that the end was near and the bankruptcy papers &#8211; most likely for Chapter 7 liquidation &#8211; needed to be prepared.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">There was little other choice, since there was no buyer and no deal to do. &#8220;We walked into that weekend,&#8221; Fuld told Congress on October 6, &#8220;[and] I firmly believed we were going to do a transaction. I don&#8217;t know this for a fact, but I think that Lehman and Merrill Lynch were in the same position on Friday night and they did a transaction with Bank of America. We went down the road with Barclays. That transaction, although I believe we were very close, never got consummated.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">For his part, Geithner regretted that the FSA decision did not come sooner. A similar decision rendered on Friday would have given everyone assembled at the Fed that weekend more time to fashion another solution. But by Sunday, the clock had run out. If Barclays had been able to deliver, or if the banks had come up with a private sector solution for liquidating Lehman&#8217;s assets in an orderly way, the Fed could have stepped in. Under those circumstances, it would have had the legal authority to do a deal similar to one it did to facilitate JPMorgan&#8217;s acquisition of Bear Stearns by lending $29 billion against a pool of Bear Stearns&#8217; assets that JPMorgan did not want.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">With Lehman Brothers, there was nothing like that on the table. That was one very big difference from the Bear Stearns situation, where JPMorgan wanted to buy the company. Central banks do liquidity; they don&#8217;t do insolvency, is how Geithner viewed the Fed&#8217;s role. He felt he did not have the authority to pump capital into Lehman while it was in free fall and Lehman&#8217;s assets were deemed to be of a lower quality than those of Bear Stearns the Fed financed for JPMorgan (and which have already lost $2.7 billion in value as of October 23). Bernanke and Paulson would get that authority only after approaching Congress to seek approval of what became the $700 billion bailout bill &#8211; a bill whose passage was undoubtedly conceivable only in the wake of fall-out in the stock market that followed Lehman&#8217;s collapse.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">McDade and Lowitt, on Lehman&#8217;s behalf, made one last-ditch effort to convince Paulson that taxpayers should bail out Lehman. They went back down to the Fed and walked the Treasury secretary through a doomsday presentation that Lehman had put together foretelling the likely global consequences in various markets &#8211; foreign exchange, swaps and derivatives, among others &#8211; if Lehman were allowed to fail. After McDade finished, Paulson told him, &#8220;You&#8217;re talking your own book. We&#8217;ve thought this over.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Paulson not only told McDade and Lowitt that Lehman had no choice but to file for bankruptcy, he also apparently told them the firm had to file for Chapter 7 liquidation by 7 p.m. Sunday night. That would mean a court-appointed trustee would take over the firm, the firm&#8217;s doors would be locked, and its assets sold as rapidly as possible. By the time McDade and Lowitt returned to the 31st floor of 745 Seventh Avenue, the Lehman board of directors had assembled to vote on the bankruptcy filing. But the directors had decided to hold off until McDade and Lowitt had returned from the Fed with their report. Since McDade had taken over as president of the firm in June, he had displaced Fuld as the firm&#8217;s day-to-day leader.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">&#8220;The words,&#8221; remembered one participant in the meeting, &#8220;that Bart used when he came into the board meeting were that &#8216;We were mandated to file. We were mandated to file.&#8217; He was very, very, very clear on that.&#8221; Some shocked board members wanted to know what that meant. What if the board decided to defy Paulson and not file for bankruptcy protection?</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Because the Fed controlled Lehman&#8217;s access to the money it needed to open for business the next day, the point was moot. But then lawyer Harvey Miller had an idea. &#8220;They can tell us to do it,&#8221; he told his client. &#8220;But they can&#8217;t tell us when. And they can&#8217;t tell us what form.&#8221; The Weil Gotshal team began preparing for a Chapter 11 filing &#8211; a reorganization plan, not a liquidation plan &#8211; for the Lehman Brothers parent company allowing the operating subsidiaries, such as the broker/dealer and the asset management business, to continue operating outside of bankruptcy. In the scheme of things, it was a technicality, but it allowed Lehman a modicum of leverage and the chance to tweak Paulson.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">But Lehman&#8217;s ordeal that Sunday night was far from over. First came a tantalizing ray of hope with the word that the Federal Reserve Board agreed to expand the collateral that investment banks could pledge to the Fed as part of both the Primary Dealer Credit Facility &#8211; the name given to the historic measure that allowed investment banks to borrow directly from the Fed window after the demise of Bear Stearns on March 16 &#8211; and the Term Securities Lending Facility, a $70 billion &#8220;collateralized borrowing facility&#8221; created on Sunday by banks to enhance liquidity in the marketplace.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">When the Lehman executives started to hear on Sunday afternoon that these windows of emergency financing were opening up, they called the New York Fed to see if it were true. If the Fed allowed Lehman to pledge its shaky collateral to the discount window &#8220;we might get a reprieve,&#8221; one Lehman banker said. But the Fed told Lehman, according to this Lehman banker, &#8220;&#8216;Yeah, we&#8217;re doing that for everybody else but you. We&#8217;re going to let you guys go.&#8217;&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">MONDAY MORNING Lehman throws in the keys</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">At close to midnight, Mark Shafir, Lehman&#8217;s global head of M&amp;A, and Mark Shapiro, the head of Lehman&#8217;s restructuring practice, went to see Fuld in his 31st floor office. They told Fuld there was a way Barclays could buy Lehman&#8217;s U.S. securities business out of bankruptcy, which would get Barclays what it really wanted and potentially save 10,000 jobs. The three men called Bob Diamond, Barclays&#8217; president and chief negotiator on the Lehman deal, on his cell phone. Diamond expressed his disappointment to them that Barclays had failed to get a deal done earlier in the day but when the men suggested to him he could buy Lehman&#8217;s U.S. securities business &#8220;clean,&#8221; he expressed great interest but needed to talk to his lawyers at Cleary, Gottlieb.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">When Diamond called back, twenty minutes later, he told them, &#8220;I can&#8217;t talk to you tonight. Call me at 7:00 in the morning.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">By that time &#8211; at 1:45 a.m. to be precise &#8211; Lehman Brothers Holdings, Inc. had filed for Chapter 11. After the bankruptcy filing, the Fed agreed to lend money to Lehman&#8217;s broker/dealer to allow it to keep operating for 24 hours, by which time a deal with Barclays could possibly be reached. At 7 a.m. Monday morning, as the calamitous effect of Lehman&#8217;s bankruptcy began spreading virally to financial capitals all over the globe, Diamond and Michael Klein, his financial advisor, got on the phone with Fuld, McDade, Shafir and Shapiro to discuss the possibility of Barclays buying Lehman&#8217;s U.S. investment banking business. Based on the due diligence work Barclays had already done on Lehman, &#8220;they were the only guys able to pick up the pieces of the melting ice cube,&#8221; Shedlin said. The Lehman team told Klein and Diamond, &#8220;We absolutely have to get this done before the [markets] open on Tuesday because we&#8217;re out of money.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">With that, Fuld told Shafir to &#8220;Go finish it.&#8221; For the next 24 hours, swarms of lawyers and bankers took over the 32nd floor of Lehman&#8217;s building. The terms of the deal had to be negotiated, which required a fast-track appraisal of Lehman&#8217;s headquarters building at 745 Seventh Avenue and two data centers in New Jersey that Barclays wanted to buy. Barclays wanted all of Lehman&#8217;s U.S. investment banking, fixed-income, equity sales-and-trading, research and certain support functions. Barclays did not want the investment management division nor any of the commercial real-estate assets.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">The plan had been to announce the deal before the market opened Tuesday morning and Lehman&#8217;s broker/dealer subsidiary ran out of cash to operate. Finally, just as the market was opening, the terms of the deal were agreed: Barclays would buy the Lehman businesses it wanted for $250 million and pay another $1.45 billion for 745 Seventh Avenue and the two data centers (later the package was reduced to $1.29 billion) plus assuming some of Lehman&#8217;s trading obligations. Barclays also agreed to provide a $500 million debtor-in-possession facility to the bankrupt holding company and also to refinance the $40 billion or so Lehman&#8217;s U.S. broker/dealer had borrowed from the Fed after the filing to keep operating.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">With that in hand, Barclays asked the FSA for its blessing. According to a Lehman executive, &#8220;It took four hours to get out of the FSA, and we thought, &#8216;Here we go again. They&#8217;re going to turn it down and we&#8217;re going to be facing a Chapter 7 liquidation anyway.&#8217;&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><strong><span style="font-size:10.5pt;color:black;font-family:Arial;">AFTERMATH</span></strong><span style="font-size:10.5pt;color:black;font-family:Arial;"></span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">At around 1 p.m. Tuesday, the FSA signed off and Barclays announced it had bought much of Lehman&#8217;s business in the U.S., subject to bankruptcy court approval, which was granted &#8211; on an extremely expedited basis &#8211; on Friday, September 19. &#8220;Lehman Brothers became a victim,&#8221; Judge James Peck said in approving the deal. &#8220;In effect, the only true icon to fall in the tsunami that has befallen the credit markets. And it saddens me.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">In the days following the collapse of Lehman Brothers, the government came to the rescue of AIG &#8211; eventually to the tune of $150 billion; created the TARP &#8211; the Troubled Asset Relief Program &#8211; for $700 billion; and saved Citigroup by pumping in $45 billion in equity and effectively underwriting $306 billion in toxic assets (Citi agreed to take the first $29 billion loss on the pool.) Goldman Sachs and Morgan Stanley would morph from investment banks into bank holding companies regulated by the FDIC, the same agency that monitors commercial banks. Wall Street would never be the same.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Many of the principal actors in the drama of the September weekend have been transformed as well. The Lehman crowd is no longer who they used to be. Bryan Marsal, a noted turnaround expert, has replaced Fuld as CEO of Lehman Brothers Holdings, and is busy liquidating the remaining assets of the firm. Fuld has been moved out of his palatial office to more modest digs on the 45th floor of the Time &amp; Life Building, which houses Fortune as well. He was spotted entering that building recently wearing a tuxedo. A security guard stopped him on his way through the lobby and said &#8220;Huh? What&#8217;s that name again?&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">No one is crying for him. In addition to some world-class real estate in Manhattan, Greenwich, Connecticut, Sun Valley, Idaho and Jupiter Island, Florida, Fuld probably has around $100 million in the bank, including $20 million just received from selling a portion of his and his wife&#8217;s art collection. He&#8217;s reportedly also considering opening his own advisory boutique.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">In addition to the $639,082 Fuld received for selling 2.87 million shares for twenty cents each on September 17 (he still has another 503,744 shares that are now worthless), he also has a grand jury subpoena from three U.S. attorney&#8217;s offices in the Eastern and Southern districts of New York, and in the district of New Jersey, which are investigating whether Lehman executives made false or misleading statements about the firm leading up to its collapse.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Thain has agreed to stay on at the combined Bank of America/Merrill after the deal closes in a few weeks. He will continue to oversee the Merrill Lynch businesses at Bank of America and report directly to Lewis. He will no doubt have a large role in helping to eliminate 35,000 jobs &#8211; as has been announced &#8211; at his new firm. His triumph of that weekend has been tainted, in part, by the fact that the fall in Bank of America&#8217;s stock since September 15 has reduced the value of the deal to Merrill&#8217;s stockholders to around $20 billion, from $50 billion. Still, that is better than the zero dollars received by Lehman&#8217;s shareholders. Thain also misjudged the zeitgeist by asking for a $10 million bonus this year from the Merrill board and had to quickly retreat in the face of negative publicity and the outrage of many, including Andrew Cuomo, New York&#8217;s attorney general.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">Geithner emerged from the weekend in the best shape of all. Puffs of smoke emanating from the palazzo suggested in the aftermath of the calamity that he was more inclined than his brethren to try to find a government solution for Lehman Brothers. In any event, he seems to have passed his six-month trial by fire and is awaiting his confirmation hearing to become secretary of the Treasury in the Obama administration.</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">When Bernanke and Paulson have discussed their decision to let Lehman fail, neither one has any doubts about the wisdom of their decision. &#8220;A public-sector solution for Lehman proved infeasible,&#8221; Bernanke said at the Economic Club of New York on October 15, &#8220;as the firm could not post sufficient collateral to provide reasonable assurance that a loan from the Federal Reserve would be repaid, and the Treasury did not have the authority to absorb billions of dollars of expected losses to facilitate Lehman&#8217;s acquisition by another firm. Consequently, little could be done except to attempt to ameliorate the effects of Lehman&#8217;s failure on the financial system.&#8221;</span></p>
<p class="MsoNormal" style="background:white;vertical-align:top;line-height:15pt;margin:0 0 15pt;"><span style="font-size:10.5pt;color:black;font-family:Arial;">On Monday morning, September 15, as the Lehman volcano was spewing molten financial lava to every corner of the globe, a pale and tired-looking Paulson &#8211; whose brother worked for Lehman, in Chicago &#8211; said at a White House press conference that he &#8220;never once considered that it was appropriate putting taxpayer money on the line in resolving Lehman Brothers.&#8221; He added, &#8220;Moral hazard is not something I take lightly.&#8221;</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=59&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/01/15/three-days-that-shook-the-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>Where Citi Went Wrong</title>
		<link>http://guanhualu.wordpress.com/2009/01/15/where-citi-went-wrong/</link>
		<comments>http://guanhualu.wordpress.com/2009/01/15/where-citi-went-wrong/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:20:05 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/2009/01/15/where-citi-went-wrong/</guid>
		<description><![CDATA[(From &#8220;The Street&#8221;) Citigroup is a mess. From the moment Wells snatched Wachovia from under Citi CEO Vikram Pandit bank in October, Citi has stumbled. Its stock price since then has plummeted from the low $20s to the mid-$3s today, as the market fears its decision to sell its Smith Barney business to Morgan Stanley [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=58&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">(From &#8220;The Street&#8221;)</span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><strong><span style="font-size:12pt;color:#212425;font-family:Arial;">Citigroup</span></strong><span style="font-size:12pt;color:#212425;font-family:Arial;"> is a mess. </span></p>
<p class="MsoNormal" style="background:white;margin:0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">From the moment <strong>Wells </strong>snatched <a href="http://www.thestreet.com/story/10441901/1/wachovia-fight-ends-with-the-right-winner.html" target="blank"><strong><span style="color:#003366;text-decoration:none;">Wachovia</span></strong></a> from under Citi CEO Vikram Pandit bank in October, Citi has stumbled. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Its stock price since then has plummeted from the low $20s to the mid-$3s today, as the market fears its decision to <a href="http://www.thestreet.com/story/10457592/1/citigroup-morgan-partner-on-smith-barney.html" target="blank"><span style="color:#003366;text-decoration:none;">sell its Smith Barney business</span></a> to <strong>Morgan Stanley</strong> <span> </span>will fail to quench its need for capital in the coming months. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">So what caused this massive implosion? A lot of Citi watchers have assigned blame for the large drop in the bank&#8217;s market cap, from $300 billion to $30 billion. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;"><a href="http://www.thestreet.com/story/10457875/1/citis-pandit-raises-doubts-as-bank-nears-breakup.html" target="blank"><span style="color:#003366;text-decoration:none;">Pandit</span></a> has been widely characterized as a weak and indecisive CEO in the press. The <em>New York Times</em> blamed Bob Rubin and risk management headed by Tom Maheras &#8212; both are now gone. In a recent interview, large Citi shareholder Prince Alwaleed bin Talal pointed the finger at former CEO Chuck Prince. A few (including John Reed, the man who merged Citi with Travelers in 1998) have also pinned Citi&#8217;s shortcomings on the &#8220;<a href="http://www.thestreet.com/story/10458109/1/opinion-where-citi-went-wrong.html##" target="_blank"><span style="color:#003366;text-decoration:none;">financial</span></a> supermarket&#8221; model masterminded by Sandy Weill. (On Tuesday, Pandit announced Citi would <a href="http://www.thestreet.com/story/10457413/1/citis-getting-smaller-but-thats-a-good-thing.html" target="blank"><span style="color:#003366;text-decoration:none;">dismantle that supermarket model</span></a>, returning to its old Citicorp roots.) </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">It turns out that Citi&#8217;s biggest mistake leading to its downfall did occur in 1998, but it wasn&#8217;t the April super-merger of Citicorp and Travelers &#8212; it was the November ousting of Jamie Dimon by then-Chair and CEO Sandy Weill over a disagreement with Weill&#8217;s daughter. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;"><a href="http://secure2.thestreet.com/cap/prm.do?OID=011642"></a>Had Dimon stayed on, he &#8212; not Chuck Prince &#8212; would have succeeded Weill and Citi would have avoided many of its missteps. Instead, Dimon moved to Chicago to head up Bank One, later triumphantly returning to New York when Bank One merged with <strong>JPMorgan Chase</strong> Dimon, who could now stare at his former employer down Park Avenue, now serves as CEO and chaiman of JPMorgan. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Wall Street has watched the spread in performance of the two banks ever since. JPMorgan&#8217;s stock is down 30% since the merger with Bank One on Jan. 15, 2004, while Citi&#8217;s stock is down 92%. </span></p>
<p class="MsoNormal" style="background:white;margin:0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">The reasons for corporate blow-ups are never simple; it&#8217;s usually true that every employee is replaceable. However, Citi has never been the same company since Dimon was pushed out. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Even a decade ago, most knowledgeable observers knew Dimon was going to be a special CEO one day. Sallie Krawcheck (who was a Citi analyst at the time) said back then: &#8220;Investors are asking two questions: What should I do with my Citigroup shares and where is Jamie going next so that I can buy the stock?&#8221; </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Dimon had been a longtime protégé of Sandy Weill&#8217;s. After graduating from Harvard Business School in 1982, Dimon turned down a job offer from <strong>Goldman Sachs</strong> <span> </span>to go and work for Weill, whom he knew through his father. Over the next 15 years, the two built an empire: Commerical <a href="http://www.thestreet.com/story/10458109/2/opinion-where-citi-went-wrong.html##" target="_blank"><span style="color:#003366;text-decoration:none;">Credit</span></a>, Primerica, Travelers and Citi. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">But in late 1998, after announcing the biggest merger ever, Weill and Dimon sparred over Weill&#8217;s daughter, Jessica Bibliowicz. Dimon refused to give Bibliowicz the job of chief asset manager of Travelers, as Weill demanded. What&#8217;s more, Dimon also wouldn&#8217;t agree to promote Weill&#8217;s son, Marc, to head up Salomon&#8217;s bond group. Weill demanded that Dimon resign. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Jessica went on to run <strong>National Financial Partners</strong>, a $100 million financial advisor that has seen its stock swoon by 93% in the past year as <em>Barron&#8217;s</em> has written negatively about its future prospects. Having left Citi in 2000, Marc now heads a small <a href="http://www.thestreet.com/story/10458109/2/opinion-where-citi-went-wrong.html##" target="_blank"><span style="color:#003366;text-decoration:none;">money management firm</span></a> in Greenwich, Conn., called City Light Capital. </span></p>
<p class="MsoNormal" style="background:white;margin:7.5pt 0;"><strong><span style="font-size:12pt;color:#212425;font-family:Arial;">All the World&#8217;s a Stage</span></strong></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">The Shakespearean similarities between what happened with Weill and Dimon are uncanny. Jaime Dimon was the Earl of Kent challenging King Lear and Weill sided with blood over an adopted son.</span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Weill now has had to watch the dismantling of everything he spent his career building. <em>The Wall Street Journal</em> quoted two friends who know Weill as characterizing his mood ranging from anger to despondence since hearing that Citi&#8217;s &#8220;financial super-market&#8221; model was being disassembled. </span></p>
<p class="MsoNormal" style="background:white;margin:0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">Vikram Pandit was a poor choice as CEO in December 2007, as he&#8217;s waited much too long to change Citi&#8217;s status quo until forced by the government, but it&#8217;s likely that neither John Thain, Ken Lewis nor Sandy Weill circa 1995 could have done much better given the circumstances the bank was facing prior to Pandit&#8217;s hiring. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">It&#8217;s not 20-20 hindsight to say that Citi&#8217;s greatest mistake was letting Dimon walk out the door. Many knew this at the time; when he said goodbye on the Salomon Smith Barney <a href="http://www.thestreet.com/story/10458109/3/opinion-where-citi-went-wrong.html##" target="_blank"><span style="color:#003366;text-decoration:none;">trading floor</span></a>, 1,000 traders gave him a standing ovation. </span></p>
<p class="MsoNormal" style="background:white;line-height:13.5pt;margin:11.25pt 0;"><span style="font-size:12pt;color:#212425;font-family:Arial;">One bad move does not usually cost a career or a company. Life has a way of giving us lots of &#8220;do-overs&#8221; to course-correct our mistakes. However, there are decisions that stick with us for the rest of our lives and we always look back on and regret. Weill&#8217;s hubris in pushing Dimon out will always be looked back on as the beginning of the end of Citigroup. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=58&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2009/01/15/where-citi-went-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
		<item>
		<title>NOBS, POINT, RETAIN</title>
		<link>http://guanhualu.wordpress.com/2008/12/18/nobs-point-retain/</link>
		<comments>http://guanhualu.wordpress.com/2008/12/18/nobs-point-retain/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 03:33:52 +0000</pubDate>
		<dc:creator>guanhualu</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[NOBS]]></category>
		<category><![CDATA[POINT]]></category>
		<category><![CDATA[RETAIN]]></category>
		<category><![CDATA[SAS Option]]></category>

		<guid isPermaLink="false">http://guanhualu.wordpress.com/2008/12/18/nobs-point-retain/</guid>
		<description><![CDATA[&#8220;NOBS=&#8221; creates and names a temporary variable whose value is usually the total number of observations in the input data set or data sets. If more than one data set is listed in the SET statement, NOBS= the total number of observations in the data sets that are listed. data test2; do sampleobs = 1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=51&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8220;NOBS=&#8221; creates and names a temporary variable whose value is usually the total number of observations in the input data set or data sets. If more than one data set is listed in the SET statement, NOBS= the total number of observations in the data sets that are listed.</p>
<p>data test2;<br />
do sampleobs = 1 to totalobs by 2;<br />
set test1 point=sampleobs nobs=totalobs;<br />
tot = totalobs;<br />
output;<br />
end;<br />
stop;<br />
run;</p>
<p>At compilation time, SAS reads the descriptor portion of each data set and assigns the value of the NOBS= variable automatically. Thus, you can refer to the NOBS= variable before the SET statement. The variable is available in the DATA step but is not added to any output data set.</p>
<p>“POINT=” specifies a temporary variable whose numeric value determines which observation is read. POINT= causes the SET statement to use random (direct) access to read a SAS data set. “STOP” statement is needed here to prevent infinite loops.</p>
<p>The next example shows that “NOBS” can be obtained without execute the “SET” statement. The NOBS= value is filled when the DATA step begins, NOT when the SET statement executes!</p>
<p>data _null_;<br />
if 0 then set test1 nobs=nobs;<br />
call symput(&#8216;totalobs&#8217;,nobs);<br />
stop;<br />
run;</p>
<p>The &#8220;dictionary&#8221; part of the dataset does not have to be read because all of that information, including the number of OBS is stored in the dictionary tables.  SAS can access the dictionary tables much faster than opening a file.</p>
<p>If a value appears in a RETAIN statement, variables that appear before it in the list are set to that value initially.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guanhualu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guanhualu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guanhualu.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guanhualu.wordpress.com&amp;blog=3722582&amp;post=51&amp;subd=guanhualu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guanhualu.wordpress.com/2008/12/18/nobs-point-retain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e46bff2e1f8adf475b60df35cb142be8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guanhualu</media:title>
		</media:content>
	</item>
	</channel>
</rss>
