<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>10001036</title>
	<link>http://lixiaoxu.lxxm.com</link>
	<description>Teaching notes of szpku dot lixiaoxu at gmail dot com</description>
	<pubDate>Wed, 19 Nov 2008 05:30:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Type III ANOVA in R</title>
		<link>http://lixiaoxu.lxxm.com/type-iii-anova-in-r/</link>
		<comments>http://lixiaoxu.lxxm.com/type-iii-anova-in-r/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 07:06:12 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[ANOVA]]></category>

		<category><![CDATA[R]]></category>

		<category><![CDATA[SAS]]></category>

		<category><![CDATA[Type III]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/11/18/type-iii-anova-in-r/</guid>
		<description><![CDATA[Type III ANOVA SS for factor A within interaction of factor B is defined as , wherein A:B  is the pure interaction effect orthogonal to main effects of A, B, and intercept. There are some details in R to get pure interaction dummy IV(s).
Data is from SAS example PROC GLM, Example 30.3: Unbalanced ANOVA for [...]]]></description>
			<content:encoded><![CDATA[<p>Type III ANOVA <em>SS</em> for factor <em>A</em> within interaction of factor <em>B</em> is defined as <img src='http://tex.72pines.com/latex.php?latex=SS_%7BA%3AB%2BA%2BB%7D-SS_%7BA%3AB%2BB%7D' title='SS_{A:B+A+B}-SS_{A:B+B}' alt='SS_{A:B+A+B}-SS_{A:B+B}' class='latex' />, wherein <em>A:B</em>  is the <font color="#ff0000">pure</font> interaction effect orthogonal to main<em> </em>effects of <em>A</em>, <em>B</em>, and intercept. There are some details in R to get pure interaction dummy <em>IV</em>(s).</p>
<p>Data is from SAS example PROC GLM, <a href="http://www.otago.ac.nz/sas/stat/chap30/sect52.htm">Example 30.3: Unbalanced ANOVA for Two-Way Design with Interaction</a></p>
<blockquote><p><code>##<br />
##Data from http://www.otago.ac.nz/sas/stat/chap30/sect52.htm<br />
##<br />
drug &lt;-  as.factor(c(t(t(rep(1,3)))%*%t(1:4))); ##Factor A<br />
disease &lt;- as.factor(c(t(t(1:3)) %*% t(rep(1,4))));##Factor B<br />
y &lt;- t(matrix(c(<br />
42	,44	,36	,13	,19	,22<br />
,33	,NA	,26	,NA	,33	,21<br />
,31	,-3	,NA	,25	,25	,24<br />
,28	,NA	,23	,34	,42	,13<br />
,NA	,34	,33	,31	,NA	,36<br />
,3	,26	,28	,32	,4	,16<br />
,NA	,NA	,1	,29	,NA	,19<br />
,NA	,11	,9	,7	,1	,-6<br />
,21	,1	,NA	,9	,3	,NA<br />
,24	,NA	,9	,22	,-2	,15<br />
,27	,12	,12	,-5	,16	,15<br />
,22	,7	,25	,5	,12	,NA<br />
),nrow=6));<br />
## verify data with http://www.otago.ac.nz/sas/stat/chap30/sect52.htm<br />
(cbind(drug,disease,y));<br />
##<br />
## make a big table<br />
y &lt;- c(y);<br />
drug &lt;- rep(drug,6);<br />
disease &lt;- rep(disease,6);<br />
##<br />
## Design the PURE interaction dummy variables<br />
m &lt;- model.matrix(lm(rep(0,length(disease)) ~  disease + drug +disease:drug));<br />
##! If lm(y~ ...) is used, the is.na(y) rows will be dropped. The residuals will be orthogonal to observed A, &amp; B rather than designed cell A &amp; B. It will be Type II SS rather than Type III SS.<br />
c &lt;- attr(m,"assign")==3;<br />
(IV_Interaction &lt;-residuals( lm(m[,c] ~ m[,!c])));<br />
##<br />
## verify data through type I &amp; II ANOVA to http://www.otago.ac.nz/sas/stat/chap30/sect52.htm<br />
## Type I ANOVA of A, defined by SS_A --<br />
anova(lm(y~drug*disease));<br />
##<br />
## Type II ANOVA of A, defined by SS_{A+B}-SS_B --<br />
require(car);<br />
Anova(lm(y~drug*disease),type='II');<br />
anova(lm(y~disease),lm(y~drug + disease))<br />
##<br />
##<br />
## Type III ANOVA of A defined by SS_{A:B+A+B}-SS_{A:B+B}<br />
t(t(c(	anova(lm(y~IV_Interaction+disease),lm(y~disease * drug))$'Sum of Sq'[2]<br />
,anova(lm(y~IV_Interaction+drug),lm(y~disease*drug))$'Sum of Sq'[2]<br />
,anova(lm(y~disease+drug),lm(y~disease*drug))$'Sum of Sq'[2])))<br />
##<br />
##</code></p></blockquote>
<p><strike>Currently, Anova(&#8230;) of <a href="http://cran.r-project.org/web/packages/car/index.html">Prof John Fox&#8217;s <em>car</em> package</a> (V. 1.2-8 or 1.2-9) used &#8220;impure&#8221; interaction dummy <em>IV</em>(s), which made its type III result relying upon the order of factor levels. </strike><strike>I think in its next version, the &#8220;pure&#8221; interaction dummy <em>IV</em>(s) will be adopted to give consistent type III <em>SS</em>.</strike></p>
<p>[<font color="#ff0000">update:</font>]</p>
<p>In <a href="http://cran.r-project.org/web/packages/car/index.html">Prof John FOX&#8217;s <em>car</em> package</a>,  with parameter <em>contrasts</em> in inputted <em>lm</em> object, Example(Anova) gave type III <em>SS</em> consistent to  other softwares. In this case, the code line should be &#8211;</p>
<blockquote><p><code> Anova(lm(y~drug*disease, contrasts=list(drug=contr.sum, disease=contr.sum)),type='III');</code></p></blockquote>
<p>Contrasts patterns are defined within lm(&#8230;) rather than Anova(&#8230;). An lm object with default contrasts parameter is inappropriate to calculate type III <em>SS</em>, or the result will rely on the level names in any nominal factor &#8211;</p>
<blockquote><p><code>require(car);<br />
M2&lt;-Moore;<br />
M2$f1&lt;-M2$fcategory;<br />
M2$f2&lt;-as.factor(- as.integer(M2$fcategory));<br />
mod1&lt;-lm(formula = conformity ~ f1 * partner.status,data=M2);<br />
mod2&lt;-lm(formula = conformity ~ f2 * partner.status,data=M2);<br />
c(Anova(mod1,type='III')$'Sum Sq'[3],Anova(mod2,type='III')$'Sum Sq'[3])</code></p></blockquote>
<p>There was hot discussion of type III ANOVA on R-help newsgroup. Thomas Lumley thought Types of <em>SS</em>  nowadays <em>don&#8217;t have to make any real sense &#8211;</em></p>
<blockquote><p><em><a href="http://tolstoy.newcastle.edu.au/R/help/05/04/3009.html">http://tolstoy.newcastle.edu.au/R/help/05/04/3009.html</a></em></p>
<p><em>This is one of many examples of an attempt to provide a mathematical answer to something that isn&#8217;t a mathematical question.</em></p>
<p><em>As people have already pointed out, in any practical testing situation you have two models you want to compare. If you are working in an interactive statistical environment, or even in a modern batch-mode system, you can fit the two models and compare them. If you want to compare two other models, you can fit them and compare them.</em></p>
<p><em>However, in the Bad Old Days this was inconvenient (or so I&#8217;m told). If you had half a dozen tests, and one of the models was the same in each test, it was a substantial saving of time and effort to fit this model just once.</em></p>
<p><em>This led to a system where you specify a model and a set of tests: eg I&#8217;m going to fit y~a+b+c+d and I want to test (some of) y~a vs y~a+b, y~a+b vs y~a+b+c and so on. Or, I want to test (some of) y~a+b+c vs y~a+b+c+d, y~a+b+d vs y~a+b+c+d and so on. This gives the &#8220;Types&#8221; of sums of squares, which are ways of specifying sets of tests. You could pick the &#8220;Type&#8221; so that the total number of linear models you had to fit was minimized. As these are merely a computational optimization, they don&#8217;t have to make any real sense. Unfortunately, as with many optimizations, they have gained a life of their own.</em></p>
<p><em>The &#8220;Type III&#8221; sums of squares are the same regardless of order, but this is a bad property, not a good one. The question you are asking when you test &#8220;for&#8221; a term X really does depend on what other terms are in the model, so order really does matter. However, since you can do anything just by specifying two models and comparing them, you don&#8217;t actually need to worry about any of this.</em></p>
<p><em>-thomas </em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/type-iii-anova-in-r/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DV predicted by two IVs, vs. triangular pyramid</title>
		<link>http://lixiaoxu.lxxm.com/dv-regressed-by-two-ivs-and-triangular-pyramid/</link>
		<comments>http://lixiaoxu.lxxm.com/dv-regressed-by-two-ivs-and-triangular-pyramid/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 21:18:48 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[geometry]]></category>

		<category><![CDATA[regression]]></category>

		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/11/14/dv-regressed-by-two-ivs-and-triangular-pyramid/</guid>
		<description><![CDATA[
&#8211; Diagram from Wiki
It is easier to imagine relation in three spatial vectors by their angles, than by their correlations. For standardized   and s , , cosines of three angles of the triangular pyramid determinate the correlation matrix, thus, all statistics of the regressions  and  . Unexpected but imaginative results on [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Dot_Product.svg/300px-Dot_Product.svg.png" border="0" /></p>
<p><em>&#8211; Diagram from <a href="http://en.wikipedia.org/wiki/Vector_projection">Wiki</a></em></p>
<p>It is easier to imagine relation in three spatial vectors by their angles, than by their correlations. For standardized <img src='http://tex.72pines.com/latex.php?latex=DV' title='DV' alt='DV' class='latex' /> <img src='http://tex.72pines.com/latex.php?latex=Y%3D%5Cleft%28y_%7B1%7D%2Cy_%7B2%7D%2C%5Cdots%2Cy_%7BN%7D%5Cright%29%5E%7B%5Ctau%7D' title='Y=\left(y_{1},y_{2},\dots,y_{N}\right)^{\tau}' alt='Y=\left(y_{1},y_{2},\dots,y_{N}\right)^{\tau}' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=IV' title='IV' alt='IV' class='latex' />s <img src='http://tex.72pines.com/latex.php?latex=X_%7B1%7D%3D%5Cleft%28x_%7B1%2C1%7D%2Cx_%7B2%2C1%7D%2C%5Cdots%2Cx_%7BN%2C1%7D%5Cright%29%5E%7B%5Ctau%7D' title='X_{1}=\left(x_{1,1},x_{2,1},\dots,x_{N,1}\right)^{\tau}' alt='X_{1}=\left(x_{1,1},x_{2,1},\dots,x_{N,1}\right)^{\tau}' class='latex' />, <img src='http://tex.72pines.com/latex.php?latex=X_%7B2%7D%3D%5Cleft%28x_%7B1%2C2%7D%2Cx_%7B2%2C2%7D%2C%5Cdots%2Cx_%7BN%2C2%7D%5Cright%29%5E%7B%5Ctau%7D' title='X_{2}=\left(x_{1,2},x_{2,2},\dots,x_{N,2}\right)^{\tau}' alt='X_{2}=\left(x_{1,2},x_{2,2},\dots,x_{N,2}\right)^{\tau}' class='latex' />, cosines of three angles of the triangular pyramid determinate the correlation matrix, thus, all statistics of the regressions <img src='http://tex.72pines.com/latex.php?latex=Y%3D%5Cbeta_%7B1%7DX_%7B1%7D%2B%5Cbeta_%7B2%7DX_%7B2%7D%2B%5Cvarepsilon' title='Y=\beta_{1}X_{1}+\beta_{2}X_{2}+\varepsilon' alt='Y=\beta_{1}X_{1}+\beta_{2}X_{2}+\varepsilon' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=Y%3D%5Cbeta_%7B1%7DX_%7B1%7D%2B%5Cvarepsilon' title='Y=\beta_{1}X_{1}+\varepsilon' alt='Y=\beta_{1}X_{1}+\varepsilon' class='latex' /> . Unexpected but imaginative results on the impact of introducing <img src='http://tex.72pines.com/latex.php?latex=X_%7B2%7D' title='X_{2}' alt='X_{2}' class='latex' /> are &#8211;</p>
<p>1. Both <img src='http://tex.72pines.com/latex.php?latex=IV' title='IV' alt='IV' class='latex' />s are nearly independent of <img src='http://tex.72pines.com/latex.php?latex=DV' title='DV' alt='DV' class='latex' />. Togethor they predict <img src='http://tex.72pines.com/latex.php?latex=DV' title='DV' alt='DV' class='latex' /> almost perfectly (<img src='http://tex.72pines.com/latex.php?latex=%5Cangle+YX_%7B1%7D%3D%5Cangle+YX_%7B2%7D%3D89%5E%7B%5Ccirc%7D' title='\angle YX_{1}=\angle YX_{2}=89^{\circ}' alt='\angle YX_{1}=\angle YX_{2}=89^{\circ}' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=%5Cangle+X_%7B1%7DX_%7B2%7D%3D177.9%5E%7B%5Ccirc%7D' title='\angle X_{1}X_{2}=177.9^{\circ}' alt='\angle X_{1}X_{2}=177.9^{\circ}' class='latex' />).</p>
<p>2. Both <img src='http://tex.72pines.com/latex.php?latex=IV' title='IV' alt='IV' class='latex' />s are almost perfectly correlated with <img src='http://tex.72pines.com/latex.php?latex=DV' title='DV' alt='DV' class='latex' />. Togethor, one of the regressive coefficient is significantly negative (<img src='http://tex.72pines.com/latex.php?latex=1%5E%7B%5Ccirc%7D' title='1^{\circ}' alt='1^{\circ}' class='latex' />, <img src='http://tex.72pines.com/latex.php?latex=0.6%5E%7B%5Ccirc%7D' title='0.6^{\circ}' alt='0.6^{\circ}' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=0.5%5E%7B%5Ccirc%7D' title='0.5^{\circ}' alt='0.5^{\circ}' class='latex' /> respectively).</p>
<p>3. Redundancy (<a href="http://books.google.com/books?id=fuq94a8C0ioC&amp;pg=PA76&amp;lpg=PA76&amp;dq=Redundancy+regression+Cohen&amp;source=bl&amp;ots=9ZvmtpyAdY&amp;sig=FmCV5PlLJ0NsqHUj4Y328AHB45A&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result">Cohen, Cohen, &amp; West, 2003</a>)   increases to full and then decreases to zero and even negative (<img src='http://tex.72pines.com/latex.php?latex=%5Cangle+YX_%7B1%7D%3D60%5E%7B%5Ccirc%7D' title='\angle YX_{1}=60^{\circ}' alt='\angle YX_{1}=60^{\circ}' class='latex' />, <img src='http://tex.72pines.com/latex.php?latex=%5Cangle+YX_%7B2%7D%3D45%7B%7D%5E%7B%5Ccirc%7D' title='\angle YX_{2}=45{}^{\circ}' alt='\angle YX_{2}=45{}^{\circ}' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=%5Cangle+X_%7B1%7DX_%7B2%7D' title='\angle X_{1}X_{2}' alt='\angle X_{1}X_{2}' class='latex' /> closes from <img src='http://tex.72pines.com/latex.php?latex=90%5E%7B%5Ccirc%7D' title='90^{\circ}' alt='90^{\circ}' class='latex' /> to <img src='http://tex.72pines.com/latex.php?latex=45%5E%7B%5Ccirc%7D' title='45^{\circ}' alt='45^{\circ}' class='latex' /> then to <img src='http://tex.72pines.com/latex.php?latex=15%5E%7B%5Ccirc%7D%2B%5Cepsilon' title='15^{\circ}+\epsilon' alt='15^{\circ}+\epsilon' class='latex' /> ).</p>
<blockquote><p><code>cy1 &lt;- 89; ## \angle YX_1<br />
cy2 &lt;- 89; ## \angle YX_2<br />
c12 &lt;- 177.9; ## \angle X_1X_2<br />
N &lt;- 100;<br />
rawdata=TRUE;</p>
<p>S &lt;- matrix(rep(1,9),3);<br />
S[1,2]&lt;-S[2,1]&lt;-cos(cy1/180*pi);<br />
S[1,3]&lt;-S[3,1]&lt;-cos(cy2/180*pi);<br />
S[2,3]&lt;-S[3,2]&lt;-cos(c12/180*pi);</p>
<p>require(MASS);## install.packages('MASS');</p>
<p>x&lt;-mvrnorm(n=N,mu=c(0,0,0),Sigma=S,empirical= TRUE);<br />
Y&lt;-x[,1];X_1&lt;-x[,2];X_2&lt;-x[,3];</p>
<p>colnames(x)&lt;-colnames(S)&lt;-rownames(S)&lt;-c('Y','X_1','X_2');</p>
<p>R2&lt;-matrix(rep(NA,3),nrow=3);<br />
colnames(R2)&lt;-c('R^2');<br />
rownames(R2)&lt;-c('Y = b_1*X_1 + e','Y =b_2*X_2 + e','Y =b_1*X_1 + b_2*X_2 + e');<br />
lm1 &lt;- lm(Y~0+X_1);<br />
lm2 &lt;- lm(Y~0+X_2);<br />
lm12 &lt;- lm(Y~0+X_1+X_2);<br />
R2[,1] &lt;- c( summary(lm1)$r.squared, summary(lm2)$r.squared, summary(lm12)$r.squared);</p>
<p>R2<br />
R2[1,1]+R2[2,1]-R2[3,1]<br />
summary(lm1)<br />
summary(lm2)<br />
summary(lm12)<br />
cat('\ncorr')<br />
S<br />
cat('\nraw data')<br />
if (rawdata) (x);</code></p></blockquote>
<p>&#8211;<br />
Cohen, J., Cohen, P., &amp; West, S. G. (2003). <em>Applied multiple regression/correlation analysis for the behavioral sciences(3rd ed.)</em>  Mahwah, NJ: Lawrence Erlbaum Associates.</p>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/dv-regressed-by-two-ivs-and-triangular-pyramid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Correction: the convenient radius for 95% confidence interval of t-test</title>
		<link>http://lixiaoxu.lxxm.com/correction-the-convenient-radius-for-95-confidence-interval-of-t-test/</link>
		<comments>http://lixiaoxu.lxxm.com/correction-the-convenient-radius-for-95-confidence-interval-of-t-test/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 18:27:30 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[t-test]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/10/14/correction-the-convenient-radius-for-95-confidence-interval-of-t-test/</guid>
		<description><![CDATA[&#8211; What do you call a tea party with more than 30 people? 
&#8211; A Z party!!!  
Joke #123 on http://www.ilstu.edu/~gcramsey/Gallery.html
2*SE is a popular convenient radius to eye 95% CI for t-test. Statisticians take t with df&#62;=30 as z. However, I was incorrect to teach that 1.96*SE could be the precise radius when df&#62;=30.
Guess what is [...]]]></description>
			<content:encoded><![CDATA[<blockquote><em>&#8211; What do you call a tea party with more than 30 people? </em><br />
<em>&#8211; A Z party!!!  </em><br />
Joke #123 on <a href="http://www.ilstu.edu/~gcramsey/Gallery.html">http://www.ilstu.edu/~gcramsey/Gallery.html</a></p></blockquote>
<p>2*<em>SE</em> is a popular convenient radius to eye 95% CI for <em>t</em>-test. Statisticians take <em>t</em> with <em>df</em>&gt;=30 as <em>z</em>. However, I was incorrect to teach that 1.96*<em>SE</em> could be the precise radius when <em>df</em>&gt;=30.</p>
<p>Guess what is the critical <em>df</em> to use decimally precise 1.96*<em>SE</em>. Larger than expected &#8211;</p>
<blockquote><p><code>r&lt;-qt(0.975,df=1:1000);</code></p>
<p><code>sum(as.integer(r &gt;= 1.965))+1;</code><br />
<code> cat('Note: Only if df &gt;= 473, 1.96 is decimally precise.\n');</code></p>
<p><code>sum(as.integer(r &gt;2))+1; </code><br />
<code> cat('</code><code>Note: </code><code>If df &gt;= 61, 2 is conservative.\n');</code></p>
<p><code>sum(as.integer(r &gt;=2.05))+1; </code><br />
<code>cat('Note: </code><code>If df &gt;= 28, 2.0 is decimally precise.\n');</code></p>
<p><code>sum(as.integer(r &gt;=2.5))+1;  </code><br />
<code>cat('Note: </code><code></code><code>If df &gt;= 6, 2 is decimally precise.\n');</code></p>
<p><code>sum(as.integer(r &gt;3))+1;</code><br />
<code>cat('Note: </code><code>If df &gt;= 4, 3 is conservative.\n');</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/correction-the-convenient-radius-for-95-confidence-interval-of-t-test/feed/</wfw:commentRss>
		</item>
		<item>
		<title>R: str(&#8230;) 与 getS3method(&#8230;,&#8230;)</title>
		<link>http://lixiaoxu.lxxm.com/r_str_gets3method/</link>
		<comments>http://lixiaoxu.lxxm.com/r_str_gets3method/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 17:57:01 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[Chinese]]></category>

		<category><![CDATA[getS3method]]></category>

		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/09/29/r-str-%e4%b8%8e-gets3methodbiplotprcomp/</guid>
		<description><![CDATA[感谢R专家XIE Yihui同学在线答疑

me: 请教两个R的技术：1.R中有没有对象浏览器之类的工具？一举看完一个对象的子子孙孙 2.怎么看深入的源代码&#62; prcomp
function (x, ...)
UseMethod("prcomp")
&#60;environment: namespace:stats&#62;
Yihui: 1. str()是很常用的一个函数，它可以充分查看对象的子子孙孙   2. 很多函数要么是S3 method，要么是调用C code，所以一般不能直接看源代码
S3 method可以用getS3method()去查看，比如prcomp就是S3方法，那么可以看它的default方法是什么：
  &#62; getS3method('prcomp','default')
function (x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL,
...)
{
x &#60;- as.matrix(x)
x &#60;- scale(x, center = center, scale = scale.)
cen &#60;- attr(x, "scaled:center")
sc &#60;- attr(x, "scaled:scale")
if (any(sc == 0))
stop("cannot rescale a constant/zero [...]]]></description>
			<content:encoded><![CDATA[<p>感谢R专家<a href="http://www.yihui.name">XIE Yihui</a>同学在线答疑</p>
<blockquote>
<p class="ArwC7c ckChnd"><span></span><span><span><span>me</span>: 请教两个R的技术：1.R中有没有对象浏览器之类的工具？一举看完一个对象的子子孙孙 2.怎么看深入的源代码&gt; <code>prcomp<br />
function (x, ...)<br />
UseMethod("prcomp")<br />
&lt;environment: namespace:stats&gt;</code></span></span></p>
<p><span></span><span><span><span>Yihui</span>: 1. <span class="nfakPe">str</span>()是很常用的一个函数，它可以充分查看对象的子子孙孙</span></span><span>  </span><span><span></span> </span><span><span>2. 很多函数要么是S3 method，要么是调用C code，所以一般不能直接看源代码</span></span></p>
<p><span></span><span><span>S3 method可以用getS3method()去查看，比如prcomp就是S3方法，那么可以看它的default方法是什么：</span></span></p>
<p><span>  </span><span><span><code>&gt; getS3method('prcomp','default')</code><br />
<code>function (x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL,<br />
...)<br />
{<br />
x &lt;- as.matrix(x)<br />
x &lt;- scale(x, center = center, scale = scale.)<br />
cen &lt;- attr(x, "scaled:center")<br />
sc &lt;- attr(x, "scaled:scale")<br />
if (any(sc == 0))<br />
stop("cannot rescale a constant/zero column to unit variance")<br />
s &lt;- svd(x, nu = 0)<br />
s$d &lt;- s$d/sqrt(max(1, nrow(x) - 1))<br />
if (!is.null(tol)) {<br />
rank &lt;- sum(s$d &gt; (s$d[1L] * tol))<br />
if (rank &lt; ncol(x)) {<br />
s$v &lt;- s$v[, 1L:rank, drop = FALSE]<br />
s$d &lt;- s$d[1L:rank]<br />
}<br />
}<br />
dimnames(s$v) &lt;- list(colnames(x), paste("PC", seq_len(ncol(s$v)),<br />
sep = ""))<br />
r &lt;- list(sdev = s$d, rotation = s$v, center = if (is.null(cen)) FALSE else cen,<br />
scale = if (is.null(sc)) FALSE else sc)<br />
if (retx)<br />
r$x &lt;- x %*% s$v<br />
class(r) &lt;- "prcomp"<br />
r<br />
}<br />
&lt;environment: namespace:stats&gt;</code></span></span></p>
<p><span></span><span><span>但所有的源代码都可以从R的源代码包中看到，Windows下经过编译了，可能有一些看不到了</span></span></p>
<p><span></span><span><span><span>me</span>: 多谢，节约俺好多搜索时间</span></span></p>
<p><span> </span><span><span><span>Yihui</span>: 嗯，我也是花了很长时间才明白S3 method的意思，呵呵</span></span></p>
<p><span></span><span><span><span>me</span>: 如果要看biplot.prcomp呢？</span></span></p>
<p><span>  </span><span><span>有help没有源代码的提示</span></span></p>
<p><span></span><span><span><span>Yihui</span>: help会告诉你biplot也是generic function，可以应用在prcomp这种class上，所以：</span></span></p>
<p><span>  </span><span><span><code>&gt; getS3method('biplot','prcomp')<br />
function (x, choices = 1:2, scale = 1, pc.biplot = FALSE, ...)<br />
{<br />
if (length(choices) != 2)<br />
stop("length of choices must be 2")<br />
if (!length(scores &lt;- x$x))<br />
stop(gettextf("object '%s' has no scores", deparse(substitute(x))),<br />
domain = NA)<br />
if (is.complex(scores))<br />
stop("biplots are not defined for complex PCA")<br />
lam &lt;- x$sdev[choices]<br />
n &lt;- NROW(scores)<br />
lam &lt;- lam * sqrt(n)<br />
if (scale &lt; 0 || scale &gt; 1)<br />
warning("'scale' is outside [0, 1]")<br />
if (scale != 0)<br />
lam &lt;- lam^scale<br />
else lam &lt;- 1<br />
if (pc.biplot)<br />
lam &lt;- lam/sqrt(n)<br />
biplot.default(t(t(scores[, choices])/lam), t(t(x$rotation[,<br />
choices]) * lam), ...)<br />
invisible()<br />
}<br />
&lt;environment: namespace:stats&gt;</code><br />
</span></span></p>
<p><span></span><span><span>这个代码里面你会看到其实是用biplot.default，所以你要继续看default的是什么代码</span></span></p>
<p><span> </span><span><span><span></span><br />
</span></span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/r_str_gets3method/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unexpectedly, the theoretically best reject-domain of T-test is bounded.</title>
		<link>http://lixiaoxu.lxxm.com/unexpectedlythetheoreticallybestreject-domainoft-testisbounded/</link>
		<comments>http://lixiaoxu.lxxm.com/unexpectedlythetheoreticallybestreject-domainoft-testisbounded/#comments</comments>
		<pubDate>Sat, 10 May 2008 16:43:49 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[26595]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/05/11/unexpectedlythetheoreticallybestreject-domainoft-testisbounded/</guid>
		<description><![CDATA[

For NHST  vs , theoretically,  is s.t.  , rather than zero. Nevertheless, pratically a large t, rejecting both  and , should not be counted as any evidence to retain or reject .
To verify the shape of  &#8211;
 x&#60;-.01*(-1000:1000);
plot(x,y=dt(x-1,df=5,ncp=0)/dt(x,df=5,ncp=0),type="l");
###compare to the noncetrality case--
## plot(x,y=dt(x,df=5,ncp=1)/dt(x,df=5,ncp=0),type="l");
]]></description>
			<content:encoded><![CDATA[<p><img src='http://tex.72pines.com/latex.php?latex=+f_%7Bt%7D%5Cleft%28x%3B%5Cmu%2Cdf%5Cright%29%5Cequiv+C%5Cleft%28df%5Cright%29%5Cleft%281%2B%5Cfrac%7B%5Cleft%28x-%5Cmu%5Cright%29%5E%7B2%7D%7D%7Bdf%7D%5Cright%29%5E%7B-%5Cfrac%7Bdf%2B1%7D%7B2%7D%7D' title=' f_{t}\left(x;\mu,df\right)\equiv C\left(df\right)\left(1+\frac{\left(x-\mu\right)^{2}}{df}\right)^{-\frac{df+1}{2}}' alt=' f_{t}\left(x;\mu,df\right)\equiv C\left(df\right)\left(1+\frac{\left(x-\mu\right)^{2}}{df}\right)^{-\frac{df+1}{2}}' class='latex' /></p>
<p><img src='http://tex.72pines.com/latex.php?latex=+%5Clambda%5Cleft%28x%3B%5Cmu_%7B0%7D%2C%5Cmu_%7B1%7D%2Cdf%5Cright%29%5Cequiv%5Cfrac%7Bf_%7Bt%7D%5Cleft%28x%3B%5Cmu_%7B1%7D%2Cdf%5Cright%29%7D%7Bf_%7Bt%7D%5Cleft%28x%3B%5Cmu_%7B0%7D%2Cdf%5Cright%29%7D%3D%5Cleft%28%5Cfrac%7Bv%2B%5Cleft%28x-%5Cmu_%7B1%7D%5Cright%29%5E%7B2%7D%7D%7Bv%2B%5Cleft%28x-%5Cmu_%7B0%7D%5Cright%29%5E%7B2%7D%7D%5Cright%29%5E%7B-%5Cfrac%7Bdf%2B1%7D%7B2%7D%7D%7B%5Clongrightarrow%5Catop+x%5Crightarrow%5Cinfty%7D1' title=' \lambda\left(x;\mu_{0},\mu_{1},df\right)\equiv\frac{f_{t}\left(x;\mu_{1},df\right)}{f_{t}\left(x;\mu_{0},df\right)}=\left(\frac{v+\left(x-\mu_{1}\right)^{2}}{v+\left(x-\mu_{0}\right)^{2}}\right)^{-\frac{df+1}{2}}{\longrightarrow\atop x\rightarrow\infty}1' alt=' \lambda\left(x;\mu_{0},\mu_{1},df\right)\equiv\frac{f_{t}\left(x;\mu_{1},df\right)}{f_{t}\left(x;\mu_{0},df\right)}=\left(\frac{v+\left(x-\mu_{1}\right)^{2}}{v+\left(x-\mu_{0}\right)^{2}}\right)^{-\frac{df+1}{2}}{\longrightarrow\atop x\rightarrow\infty}1' class='latex' /></p>
<p>For NHST <img src='http://tex.72pines.com/latex.php?latex=+H_%7B0%7D%3AT%5Csim+t_%7Bdf%7D' title=' H_{0}:T\sim t_{df}' alt=' H_{0}:T\sim t_{df}' class='latex' /> vs <img src='http://tex.72pines.com/latex.php?latex=+H_%7B1%7D%3AT-1%5Csim+t_%7Bdf%7D' title=' H_{1}:T-1\sim t_{df}' alt=' H_{1}:T-1\sim t_{df}' class='latex' />, theoretically, <img src='http://tex.72pines.com/latex.php?latex=+p%5Cleft%28t%5Cright%29%3D%5Cint_%7B%5Cleft%5C%7B+x%3A%5Clambda%5Cleft%28x%5Cright%29%5Cge%5Clambda%5Cleft%28t%5Cright%29%5Cright%5C%7D+%7Df_%7Bt%7D%5Cleft%28x%2C%5Cmu_%7B0%7D%2Cdf%5Cright%29dx' title=' p\left(t\right)=\int_{\left\{ x:\lambda\left(x\right)\ge\lambda\left(t\right)\right\} }f_{t}\left(x,\mu_{0},df\right)dx' alt=' p\left(t\right)=\int_{\left\{ x:\lambda\left(x\right)\ge\lambda\left(t\right)\right\} }f_{t}\left(x,\mu_{0},df\right)dx' class='latex' /> is s.t. <img src='http://tex.72pines.com/latex.php?latex=+%5Clim_%7Bt%5Crightarrow%5Cinfty%7Dp%5Cleft%28t%5Cright%29%3D%5Cfrac%7B1%7D%7B2%7D' title=' \lim_{t\rightarrow\infty}p\left(t\right)=\frac{1}{2}' alt=' \lim_{t\rightarrow\infty}p\left(t\right)=\frac{1}{2}' class='latex' /> , rather than zero. Nevertheless, pratically a large t, rejecting both <img src='http://tex.72pines.com/latex.php?latex=+H_%7B0%7D' title=' H_{0}' alt=' H_{0}' class='latex' /> and <img src='http://tex.72pines.com/latex.php?latex=+H_%7B1%7D' title=' H_{1}' alt=' H_{1}' class='latex' />, should not be counted as any evidence to retain or reject <img src='http://tex.72pines.com/latex.php?latex=+H_%7B0%7D' title=' H_{0}' alt=' H_{0}' class='latex' />.</p>
<p>To verify the shape of <img src='http://tex.72pines.com/latex.php?latex=+%5Clambda%5Cleft%28x%5Cright%29' title=' \lambda\left(x\right)' alt=' \lambda\left(x\right)' class='latex' /> &#8211;</p>
<blockquote><p><code> x&lt;-.01*(-1000:1000);<br />
plot(x,y=dt(x-1,df=5,ncp=0)/dt(x,df=5,ncp=0),type="l");<br />
###compare to the noncetrality case--<br />
## plot(x,y=dt(x,df=5,ncp=1)/dt(x,df=5,ncp=0),type="l");</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/unexpectedlythetheoreticallybestreject-domainoft-testisbounded/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Confidence Domain and Not-reject Domain</title>
		<link>http://lixiaoxu.lxxm.com/confidencedomainvsnot-rejectdomain/</link>
		<comments>http://lixiaoxu.lxxm.com/confidencedomainvsnot-rejectdomain/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:10:31 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[26603]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/05/10/confidencedomainvsnot-rejectdomain/</guid>
		<description><![CDATA[Either Confidence Interval (CI)  or Null Hypothesis Significance Test (NHST)  has the same business, to advise whether some sample  is or is not disliked by some hypothesized parameter .
NHST.com manages a database. For each Miss , NHST spies out all she dislikes. Mr X logs in NHST.com and inputs a girl name [...]]]></description>
			<content:encoded><![CDATA[<p>Either Confidence Interval (CI)  or Null Hypothesis Significance Test (NHST)  has the same business, to advise whether some sample <img src='http://tex.72pines.com/latex.php?latex=+X%5Cequiv%5Cleft%28X_%7B1%7D%2CX_%7B2%7D%2C%5Cdots%2CX_%7Bn%7D%5Cright%29' title=' X\equiv\left(X_{1},X_{2},\dots,X_{n}\right)' alt=' X\equiv\left(X_{1},X_{2},\dots,X_{n}\right)' class='latex' /> is or is not disliked by some hypothesized parameter <img src='http://tex.72pines.com/latex.php?latex=+%5Cvartheta' title=' \vartheta' alt=' \vartheta' class='latex' />.</p>
<p>NHST.com manages a database. For each Miss <img src='http://tex.72pines.com/latex.php?latex=+%5Cvartheta' title=' \vartheta' alt=' \vartheta' class='latex' />, NHST spies out all she dislikes. Mr <em>X</em> logs in NHST.com and inputs a girl name and his credit card number, to bet his luck whispering&#8211; <em>Does she dislike me?<br />
</em><br />
CI.com manages a database too.  For each Mr <em>X</em>, CI only needs his credit card with his name <em>X</em> on it, then serves him a full list of available girls.</p>
<p>NHST.com has been historically monopolizing the market. Nevertheless, somebody prefer visiting CI.com and find that the two may share database in most cases.</p>
<blockquote><p> Not-reject Domain of <img src='http://tex.72pines.com/latex.php?latex=+%5Cvartheta' title=' \vartheta' alt=' \vartheta' class='latex' /> is defined as <img src='http://tex.72pines.com/latex.php?latex=+A%5Cleft%28%5Cvartheta%5Cright%29%3D%5Cleft%5C%7B+x%3A%5Cvartheta%5C%3B+doesn%27t%5C%3Bdislike%5C%3Bx%5Cright%5C%7D+' title=' A\left(\vartheta\right)=\left\{ x:\vartheta\; doesn&#039;t\;dislike\;x\right\} ' alt=' A\left(\vartheta\right)=\left\{ x:\vartheta\; doesn&#039;t\;dislike\;x\right\} ' class='latex' />.</p>
<p>Confidence Domain of <em>x</em>  is defined as <img src='http://tex.72pines.com/latex.php?latex=+S%5Cleft%28x%5Cright%29%5Cequiv%5Cleft%5C%7B+%5Cvartheta%3A%5Cvartheta%5C%3B+doesn%27t%5C%3Bdislike%5C%3Bx%5Cright%5C%7D+' title=' S\left(x\right)\equiv\left\{ \vartheta:\vartheta\; doesn&#039;t\;dislike\;x\right\} ' alt=' S\left(x\right)\equiv\left\{ \vartheta:\vartheta\; doesn&#039;t\;dislike\;x\right\} ' class='latex' />.</p>
<p><img src='http://tex.72pines.com/latex.php?latex=%5Ctheta%5Cin+S%5Cleft%28X%5Cright%29%5CLeftrightarrow+%5Ctheta%5C%2Cdoes%5C%2Cnot%5C%2Cdislike%5C%2CX' title='\theta\in S\left(X\right)\Leftrightarrow \theta\,does\,not\,dislike\,X' alt='\theta\in S\left(X\right)\Leftrightarrow \theta\,does\,not\,dislike\,X' class='latex' /> <img src='http://tex.72pines.com/latex.php?latex=+%5CLeftrightarrow%5C%2CX%5Cin%5C%2CA%5Cleft%28%5Ctheta%5Cright%29' title=' \Leftrightarrow\,X\in\,A\left(\theta\right)' alt=' \Leftrightarrow\,X\in\,A\left(\theta\right)' class='latex' /></p>
<p>So, <img src='http://tex.72pines.com/latex.php?latex=+Pr_%7B%5Cvartheta%7D%5Cleft%28%5Cvartheta%5Cin+S%5Cleft%28X%5Cright%29%5Cright%29%5Cge1-%5Calpha%2C%5Cforall%5Cvartheta%5CLongleftrightarrow+Pr_%7B%5Cvartheta%7D%5Cleft%28X%5Cnotin+A%5Cleft%28%5Cvartheta%5Cright%29%5Cright%29%5Cle%5Calpha%2C%5Cforall%5Cvartheta' title=' Pr_{\vartheta}\left(\vartheta\in S\left(X\right)\right)\ge1-\alpha,\forall\vartheta\Longleftrightarrow Pr_{\vartheta}\left(X\notin A\left(\vartheta\right)\right)\le\alpha,\forall\vartheta' alt=' Pr_{\vartheta}\left(\vartheta\in S\left(X\right)\right)\ge1-\alpha,\forall\vartheta\Longleftrightarrow Pr_{\vartheta}\left(X\notin A\left(\vartheta\right)\right)\le\alpha,\forall\vartheta' class='latex' /></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/confidencedomainvsnot-rejectdomain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Automatize LISREL jobs</title>
		<link>http://lixiaoxu.lxxm.com/automatizelisreljobs/</link>
		<comments>http://lixiaoxu.lxxm.com/automatizelisreljobs/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 14:44:21 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[15430]]></category>

		<category><![CDATA[16454]]></category>

		<category><![CDATA[26590]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/04/28/automatizelisreljobs/</guid>
		<description><![CDATA[LISREL routine can run in DOS or in command line mode of windows (windows-key + R -&#62; CMD) . The command line is just like &#8211;
D:\My Documents&#62;&#8220;C:\Program Files\lisrel87\lisrel87.exe&#8221; &#8220;C:\Program Files\lisrel87\LS8EX\EX61.LS8&#8243; D:\myOutput.out
1. You only need edit and input the bold part.
2. Quotation marks are used wherever the paths or filenames include blanks.
3. The 2nd argument is [...]]]></description>
			<content:encoded><![CDATA[<p>LISREL routine can run in DOS or in command line mode of windows (windows-key + R -&gt; CMD) . The command line is just like &#8211;</p>
<blockquote><p><code>D:\My Documents&gt;<strong>&#8220;C:\Program Files\lisrel87\lisrel87.exe&#8221; &#8220;C:\Program Files\lisrel87\LS8EX\EX61.LS8&#8243; D:\myOutput.out</strong></code></p></blockquote>
<p>1. You only need edit and input the bold part.<br />
2. Quotation marks are used wherever the paths or filenames include blanks.<br />
3. The 2nd argument is the output file. You can still specify more output options in your .ls8 file.<br />
4. A .bat file can automatize batches of such lisrel jobs.</p>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/automatizelisreljobs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Developing normal pdf from symmetry &#38; independence</title>
		<link>http://lixiaoxu.lxxm.com/developingnormalpdffromsymmetryindependence/</link>
		<comments>http://lixiaoxu.lxxm.com/developingnormalpdffromsymmetryindependence/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 08:37:12 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[26604]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/04/26/developingnormalpdffromsymmetryindependence/</guid>
		<description><![CDATA[
When I was in the 3rd grade of my middle school, I enjoyed my town bookstore as a standing library.  There a series of six math-story books by Zhang Yuan-Nan impressed me a lot.  I cited a case from one in my PPT when I taught the normal distribution &#8212; the normal pdf [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.douban.com/subject/2014481/"><img src="http://otho.douban.com/lpic/s2723322.jpg" border="0" width="183" height="245" /></a></p>
<p>When I was in the 3rd grade of my middle school, I enjoyed my town bookstore as a standing library.  There a series of six math-story books by <a href="http://sb.google.com/search?hl=en&amp;newwindow=1&amp;q=%E5%BC%A0%E8%BF%9C%E5%8D%97&amp;btnG=Search">Zhang Yuan-Nan</a> impressed me a lot.  I cited a case from one in my PPT when I taught the normal distribution &#8212; the normal pdf can be derived from simple symmetry &amp; independence conditions.</p>
<p>Today I can even google out an illegal pdf of its new edition to verify the case (<a href="http://www.douban.com/subject/1398247/">2005</a>, pp. 89).  Actually I have  bought the new edition series (now 3 books) and lent them to students. Those conditions are as instinctive as&#8211;</p>
<p>1. For white noise errors on 2-D, the independence means pdf at <img src='http://tex.72pines.com/latex.php?latex=+%28x%2Cy%29' title=' (x,y)' alt=' (x,y)' class='latex' /> is the product of 1-D pdf, that is, <img src='http://tex.72pines.com/latex.php?latex=+%5Cphi%5Cleft%28x%5Cright%29%5Cphi%5Cleft%28y%5Cright%29+' title=' \phi\left(x\right)\phi\left(y\right) ' alt=' \phi\left(x\right)\phi\left(y\right) ' class='latex' />.</p>
<p>2. The symmetry means pdf at <img src='http://tex.72pines.com/latex.php?latex=+%28x%2Cy%29' title=' (x,y)' alt=' (x,y)' class='latex' /> is just a function of <img src='http://tex.72pines.com/latex.php?latex=+x%5E%7B2%7D%2By%5E%7B2%7D' title=' x^{2}+y^{2}' alt=' x^{2}+y^{2}' class='latex' />, nothing to do with direction. That is, <img src='http://tex.72pines.com/latex.php?latex=+%5Cphi%5Cleft%28x%5Cright%29%5Cphi%5Cleft%28y%5Cright%29%3Df%5Cleft%28x%5E%7B2%7D%2By%5E%7B2%7D%5Cright%29' title=' \phi\left(x\right)\phi\left(y\right)=f\left(x^{2}+y^{2}\right)' alt=' \phi\left(x\right)\phi\left(y\right)=f\left(x^{2}+y^{2}\right)' class='latex' />.</p>
<p>So, <img src='http://tex.72pines.com/latex.php?latex=++f%5Cleft%28x%5E%7B2%7D%5Cright%29f%5Cleft%28y%5E%7B2%7D%5Cright%29%3Df%5Cleft%28x%5E%7B2%7D%2B0%5Cright%29f%5Cleft%280%2By%5E%7B2%7D%5Cright%29%3D%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29f%5Cleft%28x%5E%7B2%7D%2By%5E%7B2%7D%5Cright%29' title='  f\left(x^{2}\right)f\left(y^{2}\right)=f\left(x^{2}+0\right)f\left(0+y^{2}\right)=\phi^{2}\left(0\right)f\left(x^{2}+y^{2}\right)' alt='  f\left(x^{2}\right)f\left(y^{2}\right)=f\left(x^{2}+0\right)f\left(0+y^{2}\right)=\phi^{2}\left(0\right)f\left(x^{2}+y^{2}\right)' class='latex' />.</p>
<p>For middle school students, the book stated a gap here to arrive at the final result <img src='http://tex.72pines.com/latex.php?latex=++f%5Cleft%28x%5E%7B2%7D%5Cright%29%3Dke%5E%7Bbx%5E%7B2%7D%7D' title='  f\left(x^{2}\right)=ke^{bx^{2}}' alt='  f\left(x^{2}\right)=ke^{bx^{2}}' class='latex' />, which is <img src='http://tex.72pines.com/latex.php?latex=+++%5Cphi%5Cleft%28x%5Cright%29%3D%5Cfrac%7B1%7D%7B%5Cphi%5Cleft%280%5Cright%29%7Df%5Cleft%28x%5E%7B2%7D%2B0%5Cright%29%3D%5Cfrac%7Bk%7D%7B%5Cphi%5Cleft%280%5Cright%29%7De%5E%7Bbx%5E%7B2%7D%7D' title='   \phi\left(x\right)=\frac{1}{\phi\left(0\right)}f\left(x^{2}+0\right)=\frac{k}{\phi\left(0\right)}e^{bx^{2}}' alt='   \phi\left(x\right)=\frac{1}{\phi\left(0\right)}f\left(x^{2}+0\right)=\frac{k}{\phi\left(0\right)}e^{bx^{2}}' class='latex' />.</p>
<p>I think non-math graduate students with interests can close the gap by themselves with following small hints.</p>
<p>Denote <img src='http://tex.72pines.com/latex.php?latex=+%5Calpha%3Dx%5E%7B2%7D%2C%5Cbeta%3Dy%5E%7B2%7D' title=' \alpha=x^{2},\beta=y^{2}' alt=' \alpha=x^{2},\beta=y^{2}' class='latex' />.<br />
We have<br />
<img src='http://tex.72pines.com/latex.php?latex=+%5Clog+f%5Cleft%28%5Calpha%5Cright%29%2B%5Clog+f%5Cleft%28%5Cbeta%5Cright%29%3D%5Clog%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29%2B%5Clog+f%5Cleft%28%5Calpha%2B%5Cbeta%5Cright%29' title=' \log f\left(\alpha\right)+\log f\left(\beta\right)=\log\phi^{2}\left(0\right)+\log f\left(\alpha+\beta\right)' alt=' \log f\left(\alpha\right)+\log f\left(\beta\right)=\log\phi^{2}\left(0\right)+\log f\left(\alpha+\beta\right)' class='latex' />,<br />
or<br />
<img src='http://tex.72pines.com/latex.php?latex=+%5C%3B%5C%3B%5Cleft%5B%5Clog+f%5Cleft%28%5Calpha%5Cright%29-%5Clog%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29%5Cright%5D%2B%5Cleft%5B%5Clog+f%5Cleft%28%5Cbeta%5Cright%29-%5Clog%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29%5Cright%5D+' title=' \;\;\left[\log f\left(\alpha\right)-\log\phi^{2}\left(0\right)\right]+\left[\log f\left(\beta\right)-\log\phi^{2}\left(0\right)\right] ' alt=' \;\;\left[\log f\left(\alpha\right)-\log\phi^{2}\left(0\right)\right]+\left[\log f\left(\beta\right)-\log\phi^{2}\left(0\right)\right] ' class='latex' />  <img src='http://tex.72pines.com/latex.php?latex=+%3D%5Cleft%28%5Clog+f%5Cleft%28%5Calpha%2B%5Cbeta%5Cright%29-%5Clog%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29%5Cright%29' title=' =\left(\log f\left(\alpha+\beta\right)-\log\phi^{2}\left(0\right)\right)' alt=' =\left(\log f\left(\alpha+\beta\right)-\log\phi^{2}\left(0\right)\right)' class='latex' />.<br />
Denote  <img src='http://tex.72pines.com/latex.php?latex=+g%5Cleft%28%5Calpha%5Cright%29%3D%5Clog+f%5Cleft%28%5Calpha%5Cright%29-%5Clog%5Cphi%5E%7B2%7D%5Cleft%280%5Cright%29+' title=' g\left(\alpha\right)=\log f\left(\alpha\right)-\log\phi^{2}\left(0\right) ' alt=' g\left(\alpha\right)=\log f\left(\alpha\right)-\log\phi^{2}\left(0\right) ' class='latex' />.<br />
That is, <img src='http://tex.72pines.com/latex.php?latex=++g%5Cleft%28%5Calpha%5Cright%29%2Bg%5Cleft%28%5Cbeta%5Cright%29%3Dg%5Cleft%28%5Calpha%2B%5Cbeta%5Cright%29' title='  g\left(\alpha\right)+g\left(\beta\right)=g\left(\alpha+\beta\right)' alt='  g\left(\alpha\right)+g\left(\beta\right)=g\left(\alpha+\beta\right)' class='latex' />.</p>
<p>Now to prove <img src='http://tex.72pines.com/latex.php?latex=+g%5Cleft%28%5Cfrac%7Bm%7D%7Bn%7D%5Cright%29%3D%5Cfrac%7Bm%7D%7Bn%7Dg%5Cleft%281%5Cright%29%2C%5Cforall+m%2Cn%5Cin%5Cmathbb%7BN%7D' title=' g\left(\frac{m}{n}\right)=\frac{m}{n}g\left(1\right),\forall m,n\in\mathbb{N}' alt=' g\left(\frac{m}{n}\right)=\frac{m}{n}g\left(1\right),\forall m,n\in\mathbb{N}' class='latex' />. With continuousness, it gets <img src='http://tex.72pines.com/latex.php?latex=+g%5Cleft%28%5Calpha%5Cright%29%3D%5Calpha+g%5Cleft%281%5Cright%29%2C%5Cforall%5Calpha%5Cin%5Cmathbb%7BR%7D' title=' g\left(\alpha\right)=\alpha g\left(1\right),\forall\alpha\in\mathbb{R}' alt=' g\left(\alpha\right)=\alpha g\left(1\right),\forall\alpha\in\mathbb{R}' class='latex' />.</p>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/developingnormalpdffromsymmetryindependence/feed/</wfw:commentRss>
		</item>
		<item>
		<title>愉快地发现SciTE和LyX在WinXP下都支持中文</title>
		<link>http://lixiaoxu.lxxm.com/yukuaidifaxianscitehelyxzaiwinxpxiaduzhichizhongwen/</link>
		<comments>http://lixiaoxu.lxxm.com/yukuaidifaxianscitehelyxzaiwinxpxiaduzhichizhongwen/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 23:09:00 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[Chinese]]></category>

		<category><![CDATA[12639]]></category>

		<category><![CDATA[12640]]></category>

		<category><![CDATA[26596]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/02/21/yukuaidifaxianscitehelyxzaiwinxpxiaduzhichizhongwen/</guid>
		<description><![CDATA[愉快地发现我在WinXP上最常用的编辑工具SciTE(当前版本1.75) 和 LyX(当前版本1.5.3) 都支持unicode（也就是说，支持中文）。之前不了解，只因为缺省设置不支持中文。需要手工操作修改设置。
SciTE的设置是Options-&#62;Open Global Options File，编辑SciTEGlobal.properties，找到如下段落
# Unicode
#code.page=65001
code.page=0
#character.set=204
# Required for Unicode to work on GTK+:
#LC_CTYPE=en_US.UTF-8
#output.code.page=65001
修改为
# Unicode
code.page=65001
#code.page=0
character.set=204
# Required for Unicode to work on GTK+:
LC_CTYPE=en_US.UTF-8
output.code.page=65001
保存。然后关闭再打开SciTE，就会发现不再出现中文被切一半的现象。如果编辑的文档格式不是utf-8而是ucs-2 ，还可以在File-&#62;Encoding 里临时选。
[update] 除了utf-8, SciTE 还支持其它的中文编码设定，比如
code.page=936
output.code.page=936
character.set=134
此外，我还推荐把SciTEGlobal.properties文件中的line.margin.visible=1 和 wrap=1 两处的注释#号去掉，效果是缺省显示行号，并使超长的行折行显示。SciTE的优点太多了&#8211;开源免费；轻巧，启动快；支持Ctrl+鼠标中轮滚动无级缩放；支持Ctrl+回车 前文已出现过的拼写自动补齐选项；支持Alt键方形选段；&#8230;
LyX(版本&#62;=1.5.1)在winXP已经可以在.lyx文件正文和公式框中录入中文。麻烦的是输出中文的pdf。要实现这点，首先需要在LyX菜单Document-&#62;Settings-&#62;Language-&#62;选Chinese(simplified)，并勾选 Use language&#8217;s default encoding设为English + GBK encoding组合（发现Language选项只影响F7拼写检查，而Encoding只影响pdf/dvi生成；还可以点Save as Document Defaults设为今后的缺省）。我试了若干方案，最后才试成功用南开网站上的MiKTeX+中文插件（Patches4miktex.exe），实现了输出正文的中文为pdf，美中不足是公式框中还不能实现中文公式输出pdf，甚至在Document中的中文设置选定后，公式框中的中文都不能在LyX环境中正确显示，期待后续的LyX版本处理好这个问题。
新版本LyX已经引入了文档版本控制，相当于word中的revision功能，有待深入试用。目前LyX仍不支持Ctrl+鼠标中轮滚动无级缩放，如果公式显得太小，需要在菜单设置中修改显示缩放比例：Tools-&#62;Preferences-&#62;Look and feel-&#62;Screen fonts-&#62;Zoom %。这可能是比较容易在后续版本中实现的功能。
相关网址：SciTE主页  http://www.scintilla.org/SciTE.html  LyX主页 http://lyx.org/     [...]]]></description>
			<content:encoded><![CDATA[<p>愉快地发现我在WinXP上最常用的编辑工具SciTE(当前版本1.75) 和 LyX(当前版本1.5.3) 都支持unicode（也就是说，支持中文）。之前不了解，只因为缺省设置不支持中文。需要手工操作修改设置。</p>
<p>SciTE的设置是Options-&gt;Open Global Options File，编辑SciTEGlobal.properties，找到如下段落</p>
<blockquote><p># Unicode<br />
#code.page=65001<br />
code.page=0<br />
#character.set=204<br />
# Required for Unicode to work on GTK+:<br />
#LC_CTYPE=en_US.UTF-8<br />
#output.code.page=65001</p></blockquote>
<p>修改为</p>
<blockquote><p># Unicode<br />
code.page=65001<br />
#code.page=0<br />
character.set=204<br />
# Required for Unicode to work on GTK+:<br />
LC_CTYPE=en_US.UTF-8<br />
output.code.page=65001</p></blockquote>
<p>保存。然后关闭再打开SciTE，就会发现不再出现中文被切一半的现象。如果编辑的文档格式不是utf-8而是ucs-2 ，还可以在File-&gt;Encoding 里临时选。</p>
<p>[<font color="#ff0000">update</font>] 除了utf-8, SciTE 还支持其它的中文编码设定，比如</p>
<blockquote><p>code.page=936<br />
output.code.page=936<br />
character.set=134</p></blockquote>
<p>此外，我还推荐把SciTEGlobal.properties文件中的line.margin.visible=1 和 wrap=1 两处的注释#号去掉，效果是缺省显示行号，并使超长的行折行显示。SciTE的优点太多了&#8211;开源免费；轻巧，启动快；支持Ctrl+鼠标中轮滚动无级缩放；支持Ctrl+回车 前文已出现过的拼写自动补齐选项；支持Alt键方形选段；&#8230;</p>
<p>LyX(版本&gt;=1.5.1)在winXP已经可以在.lyx文件正文和公式框中录入中文。麻烦的是输出中文的pdf。要实现这点，首先需要在LyX菜单Document-&gt;Settings-&gt;Language-&gt;<strike>选Chinese(simplified)，并勾选 Use language&#8217;s default encoding</strike>设为English + GBK encoding组合（发现Language选项只影响F7拼写检查，而Encoding只影响pdf/dvi生成；还可以点Save as Document Defaults设为今后的缺省）。我试了若干方案，最后才试成功用<a href="http://miktex.math.nankai.edu.cn/">南开网站上的MiKTeX+<font face="Times New Roman,Times"><font face="Times New Roman,Times"><font face="Times New Roman,Times"><font face="Times New Roman,Times">中文插件（<font face="Times New Roman,Times">Patches4miktex.exe）</font></font></font></font></font></a>，实现了输出正文的中文为pdf，美中不足是公式框中还不能实现中文公式输出pdf，甚至在Document中的中文设置选定后，公式框中的中文都不能在LyX环境中正确显示，期待后续的LyX版本处理好这个问题。</p>
<p>新版本LyX已经引入了文档版本控制，相当于word中的revision功能，有待深入试用。目前LyX仍不支持Ctrl+鼠标中轮滚动无级缩放，如果公式显得太小，需要在菜单设置中修改显示缩放比例：Tools-&gt;Preferences-&gt;Look and feel-&gt;Screen fonts-&gt;Zoom %。这可能是比较容易在后续版本中实现的功能。</p>
<p>相关网址：SciTE主页  <a href="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html</a>  LyX主页 <a href="http://lyx.org/">http://lyx.org/</a>               南开MiKTeX<font face="Times New Roman,Times"><font face="Times New Roman,Times"><font face="Times New Roman,Times"><font face="Times New Roman,Times">中文插件 <a href="http://miktex.math.nankai.edu.cn/">http://miktex.math.nankai.edu.cn/</a></font></font></font></font><a href="http://miktex.org/"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/yukuaidifaxianscitehelyxzaiwinxpxiaduzhichizhongwen/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My first wp plugin work: LaTeX_Math_cgi 1.0</title>
		<link>http://lixiaoxu.lxxm.com/latex_math_cgi/</link>
		<comments>http://lixiaoxu.lxxm.com/latex_math_cgi/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 23:32:29 +0000</pubDate>
		<dc:creator>lixiaoxu</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[12439]]></category>

		<category><![CDATA[12441]]></category>

		<category><![CDATA[26596]]></category>

		<category><![CDATA[26597]]></category>

		<guid isPermaLink="false">http://lixiaoxu.lxxm.com/2008/02/08/latex_math_cgi/</guid>
		<description><![CDATA[
Install: Download LaTeX_Math_cgi.zip and unzip it to your wordpress&#8217; /wp-content/plugins/ directory.
Activate it in Plugins menu. View its options in Options &#62; LaTeX tab &#8211;
It is actually used as a mimeTeX plugin rather than just a  plugin. My contribution is technically trivial. But, you must need it if you change from a light theme to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://picasaweb.google.com/lixiaoxu/Psychometrics/photo#5168458389553416722"><img src="http://lh4.google.com/lixiaoxu/R7oNhYm4ChI/AAAAAAAAANw/4j8woK0Wbzw/s288/shot.jpg" align="right" border="0" /></a><br />
Install: Download <a href="http://lixiaoxu.lxxm.com/files/2008/02/latex-math-cgi.zip" title="LaTeX_Math_cgi 1.0">LaTeX_Math_cgi.zip</a> and unzip it to your wordpress&#8217; /wp-content/plugins/ directory.</p>
<p>Activate it in <em>Plugin</em>s menu. View its options in <em>Options &gt; LaTeX</em> tab &#8211;</p>
<p>It is actually used as a <a href="http://www.forkosh.com/mimetex.html">mimeTeX</a> plugin rather than just a <a href="http://www.latex-project.org/"><img src='http://tex.72pines.com/latex.php?latex=+L%5E%7BA%7DT_%7BE%7DX' title=' L^{A}T_{E}X' alt=' L^{A}T_{E}X' class='latex' /></a> plugin. My contribution is technically trivial. But, you must need it if you change from a light theme to a cool black one while find the default mimeTeX images are black in front and transparent in background. This plugin provides mimeTeX&#8217;s <em>\reverse </em>and <em>\opaque</em> options to tune your math forms to your wp theme without editing them one by one.</p>
<p>The 2nd function is the option for your cgi URL. The default is  <em>http://www.forkosh.dreamhost.com/mimetex.cgi</em>   You can DIY one following <a href="http://www.forkosh.com/mimetex.html">Forkosh&#8217;s instructions</a> and then set it like<em> /cgi-bin/mimetex.cgi</em>   It can help your visitors not to cost Forkosh&#8217;s  unselfish bandwidth.</p>
]]></content:encoded>
			<wfw:commentRss>http://lixiaoxu.lxxm.com/latex_math_cgi/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
