<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://metabolomics.jp/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FMath%2FLR%2FR_LM</id>
		<title>Aritalab:Lecture/Math/LR/R LM - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FMath%2FLR%2FR_LM"/>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;action=history"/>
		<updated>2026-06-14T21:10:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=314696&amp;oldid=prev</id>
		<title>Adm: /* Rによる回帰分析 */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=314696&amp;oldid=prev"/>
				<updated>2015-07-15T02:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rによる回帰分析&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:37, 15 July 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; pairs(iris[1:4], main = &amp;quot;Iris Data&amp;quot;, pch=21, bg = c(&amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;,&amp;quot;blue&amp;quot;)[unclass(iris$Species)])&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; pairs(iris[1:4], main = &amp;quot;Iris Data&amp;quot;, pch=21, bg = c(&amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;,&amp;quot;blue&amp;quot;)[unclass(iris$Species)])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Sepal&lt;/del&gt;.Length, Sepal.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Width, Petal&lt;/del&gt;.Length, Petal.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Width, Species の 5 変数があり総当りの相関が出ています。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;萼片の長さと幅（Sepal&lt;/ins&gt;.Length, Sepal.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Width）、花びらの長さと幅（Petal&lt;/ins&gt;.Length, Petal.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Width）について、3種（Species） のデータについて総当りの相関が出ています。この中で &lt;/ins&gt;Petal(花弁）の Length と Width &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;はとても相関が高いことを確認しましょう。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;この中で &lt;/del&gt;Petal(花弁）の Length と Width &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;はとても相関が高いことを確認しましょう。Sepal（萼片）の長さはどの変数と関連するのでしょうか。重回帰分析をおこないます。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;では、Sepal（萼片）の長さはどの変数と関連するのでしょうか。ここで重回帰分析をおこないます。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; s &amp;lt;- lm (Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width , data=iris)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; s &amp;lt;- lm (Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width , data=iris)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;F-statistic: 295.5 on 3 and 146 DF,&amp;#160; p-value: &amp;lt; 2.2e-16 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;F-statistic: 295.5 on 3 and 146 DF,&amp;#160; p-value: &amp;lt; 2.2e-16 &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;目的変量が Sepal.Length&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, 説明変量が &lt;/del&gt;Sepal.Width, Petal.Length, Petal.Width &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;です。各変量の重みは &lt;/del&gt;summary の Estimate として表示されています。Significance code &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;は帰無仮説に対する有意差を示しています。Sepal&lt;/del&gt;.Width&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, Petal.Length が大きく関係することがわかります。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;目的変量が Sepal.Length &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;です。説明変量として &lt;/ins&gt;Sepal.Width, Petal.Length, Petal.Width &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;を使います。各変量の重みは &lt;/ins&gt;summary の Estimate として表示されています。Significance code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;は帰無仮説に対する有意差を示しています。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;しかし Petal.Length と Petal.Width &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;は相関が高かったのではないでしょうか。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;上の結果から、全てのパラメータが有意に関与することがわかります。そして Petal&lt;/ins&gt;.Width &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;だけがマイナスの影響になっています。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;しかし Petal.Length と Petal.Width &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;は相関が高かったのではないでしょうか。なぜ両者は正と負の値になっているのでしょう。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; cor(iris$Petal.Length, iris$Petal.Width)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; cor(iris$Petal.Length, iris$Petal.Width)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[1] 0.9628654&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[1] 0.9628654&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;これほど相関するのに重回帰分析の Estimate は Length と Width で逆になっています。これは問題です。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Length と Width はほぼ同じ意味を示すのに Estimate が逆になるからです。実際、Petal&lt;/del&gt;.Width を説明変数から外してもほとんど同じ精度を得ることができます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;これこそ重回帰分析の弱点で、共線性と呼ばれる問題です。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;実際、Petal&lt;/ins&gt;.Width を説明変数から外してもほとんど同じ精度を得ることができます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;変数選択は step 関数でも行えます。 AIC (Akaike Information Criterion) を指標に変数を除去するはずですが、Petal.Width は残るようです。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;変数選択は step 関数でも行えます。 AIC (Akaike Information Criterion) を指標に変数を除去するはずですが、Petal.Width は残るようです。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304474&amp;oldid=prev</id>
		<title>Adm: /* Rによる回帰分析 */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304474&amp;oldid=prev"/>
				<updated>2013-06-04T01:47:10Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rによる回帰分析&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:47, 4 June 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; help(&amp;quot;iris&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; help(&amp;quot;iris&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;helpをみるとアンダーソンによる菖蒲のデータ（50ずつ3種）であることがわかります。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;helpをみるとアンダーソンが用いたアヤメのデータ（50ずつ3種）であることがわかります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;アヤメ3種 I. setosa, versicolor, virginica についての萼片と花びらの長さと幅が記録してあります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;原論文では setosa が他 2 種と形態が異なること、versicolor は setosa と virginica の雑種かもしれないことが示唆されています。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; require(graphics)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; require(graphics)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304473&amp;oldid=prev</id>
		<title>Adm: /* Rによる回帰分析 */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304473&amp;oldid=prev"/>
				<updated>2013-06-04T01:41:37Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rによる回帰分析&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:41, 4 June 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Rによる回帰分析==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Rによる回帰分析==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;R では lm という関数で回帰分析ができます。Rに組み込んである &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;airquality &lt;/del&gt;というデータをみてみます。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;R では lm という関数で回帰分析ができます。Rに組み込んである &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;iris &lt;/ins&gt;というデータをみてみます。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; help(&amp;quot;iris&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; help(&amp;quot;iris&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;アンダーソンによる菖蒲のデータです。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;helpをみるとアンダーソンによる菖蒲のデータ（50ずつ3種）であることがわかります。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; require(graphics)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;gt; require(graphics)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304471&amp;oldid=prev</id>
		<title>Adm at 01:20, 4 June 2013</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304471&amp;oldid=prev"/>
				<updated>2013-06-04T01:20:03Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:20, 4 June 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;参考サイト&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;;参考サイト&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* [http://www.okada.jp.org/RWiki/?R%A4%CE%B4%F0%CB%DC%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%C3%E6%A4%CE%C2%BF%CA%D1%CE%CC%B2%F2%C0%CF%B4%D8%BF%F4%B0%EC%CD%F7#f9670e78 RJPWiki: Rの基本パッケージ中の多変量解析関数一覧]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* [http://www.okada.jp.org/RWiki/?R%A4%CE%B4%F0%CB%DC%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%C3%E6%A4%CE%C2%BF%CA%D1%CE%CC%B2%F2%C0%CF%B4%D8%BF%F4%B0%EC%CD%F7#f9670e78 RJPWiki: Rの基本パッケージ中の多変量解析関数一覧]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* [http://aoki2.si.gunma-u.ac.jp/R/pca.html 統計学自習ノート]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Rによる回帰分析==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Rによる回帰分析==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304467&amp;oldid=prev</id>
		<title>Adm: /* RによるPCA */</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304467&amp;oldid=prev"/>
				<updated>2013-06-04T00:36:58Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;RによるPCA&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:36, 4 June 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;- Petal.Length&amp;#160; 1&amp;#160;  15.4657 29.911 -235.86&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;- Petal.Length&amp;#160; 1&amp;#160;  15.4657 29.911 -235.86&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;==RによるPCA==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;主成分分析は prcomp という関数で実行します。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;gt; s &amp;lt;- prcomp(iris[1:4], scale=FALSE)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;gt; biplot(s,xlabs = iris[,1])&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;gt; summary(s)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Importance of components:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; PC1&amp;#160; &amp;#160;  PC2&amp;#160; &amp;#160; PC3&amp;#160; &amp;#160;  PC4&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Standard deviation&amp;#160; &amp;#160;  2.0563 0.49262 0.2797 0.15439&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Proportion of Variance 0.9246 0.05307 0.0171 0.00521&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Cumulative Proportion&amp;#160; 0.9246 0.97769 0.9948 1.00000&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;主成分 PC1 でほとんどの分散を説明できることがわかります。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;プロットをみると、PC1は Petal.Width と Sepal.Width の寄与が大きいようです。またPetal.Length と Petal.Width が同じ内容を示すこと（ベクトルがほぼ同じ）がわかります。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304465&amp;oldid=prev</id>
		<title>Adm: Created page with &quot;;参考サイト * [http://www.okada.jp.org/RWiki/?R%A4%CE%B4%F0%CB%DC%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%C3%E6%A4%CE%C2%BF%CA%D1%CE%CC%B2%F2%C0%CF%B4%D8%BF%F4%B0%EC%CD%F7#f9670e78...&quot;</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/Math/LR/R_LM&amp;diff=304465&amp;oldid=prev"/>
				<updated>2013-06-03T15:53:55Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;;参考サイト * [http://www.okada.jp.org/RWiki/?R%A4%CE%B4%F0%CB%DC%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%C3%E6%A4%CE%C2%BF%CA%D1%CE%CC%B2%F2%C0%CF%B4%D8%BF%F4%B0%EC%CD%F7#f9670e78...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;;参考サイト&lt;br /&gt;
* [http://www.okada.jp.org/RWiki/?R%A4%CE%B4%F0%CB%DC%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%C3%E6%A4%CE%C2%BF%CA%D1%CE%CC%B2%F2%C0%CF%B4%D8%BF%F4%B0%EC%CD%F7#f9670e78 RJPWiki: Rの基本パッケージ中の多変量解析関数一覧]&lt;br /&gt;
* [http://aoki2.si.gunma-u.ac.jp/R/pca.html 統計学自習ノート]&lt;br /&gt;
&lt;br /&gt;
==Rによる回帰分析==&lt;br /&gt;
&lt;br /&gt;
R では lm という関数で回帰分析ができます。Rに組み込んである airquality というデータをみてみます。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; help(&amp;quot;iris&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
アンダーソンによる菖蒲のデータです。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; require(graphics)&lt;br /&gt;
&amp;gt; pairs(iris[1:4], main = &amp;quot;Iris Data&amp;quot;, pch=21, bg = c(&amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;,&amp;quot;blue&amp;quot;)[unclass(iris$Species)])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species の 5 変数があり総当りの相関が出ています。&lt;br /&gt;
この中で Petal(花弁）の Length と Width はとても相関が高いことを確認しましょう。Sepal（萼片）の長さはどの変数と関連するのでしょうか。重回帰分析をおこないます。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; s &amp;lt;- lm (Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width , data=iris)&lt;br /&gt;
&amp;gt; summary(s)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Call:&lt;br /&gt;
lm(formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, &lt;br /&gt;
    data = iris)&lt;br /&gt;
&lt;br /&gt;
Residuals:&lt;br /&gt;
     Min       1Q   Median       3Q      Max &lt;br /&gt;
-0.82816 -0.21989  0.01875  0.19709  0.84570 &lt;br /&gt;
&lt;br /&gt;
Coefficients:&lt;br /&gt;
             Estimate Std. Error t value Pr(&amp;gt;|t|)    &lt;br /&gt;
(Intercept)   1.85600    0.25078   7.401 9.85e-12 ***&lt;br /&gt;
Sepal.Width   0.65084    0.06665   9.765  &amp;lt; 2e-16 ***&lt;br /&gt;
Petal.Length  0.70913    0.05672  12.502  &amp;lt; 2e-16 ***&lt;br /&gt;
Petal.Width  -0.55648    0.12755  -4.363 2.41e-05 ***&lt;br /&gt;
---&lt;br /&gt;
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 &lt;br /&gt;
&lt;br /&gt;
Residual standard error: 0.3145 on 146 degrees of freedom&lt;br /&gt;
Multiple R-squared: 0.8586,     Adjusted R-squared: 0.8557 &lt;br /&gt;
F-statistic: 295.5 on 3 and 146 DF,  p-value: &amp;lt; 2.2e-16 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
目的変量が Sepal.Length, 説明変量が Sepal.Width, Petal.Length, Petal.Width です。各変量の重みは summary の Estimate として表示されています。Significance code は帰無仮説に対する有意差を示しています。Sepal.Width, Petal.Length が大きく関係することがわかります。&lt;br /&gt;
しかし Petal.Length と Petal.Width は相関が高かったのではないでしょうか。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; cor(iris$Petal.Length, iris$Petal.Width)&lt;br /&gt;
[1] 0.9628654&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
これほど相関するのに重回帰分析の Estimate は Length と Width で逆になっています。これは問題です。&lt;br /&gt;
Length と Width はほぼ同じ意味を示すのに Estimate が逆になるからです。実際、Petal.Width を説明変数から外してもほとんど同じ精度を得ることができます。&lt;br /&gt;
&lt;br /&gt;
変数選択は step 関数でも行えます。 AIC (Akaike Information Criterion) を指標に変数を除去するはずですが、Petal.Width は残るようです。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; s.step1 &amp;lt;- step(s)&lt;br /&gt;
Start:  AIC=-343.04&lt;br /&gt;
Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width&lt;br /&gt;
&lt;br /&gt;
               Df Sum of Sq    RSS     AIC&lt;br /&gt;
&amp;lt;none&amp;gt;                      14.445 -343.04&lt;br /&gt;
- Petal.Width   1    1.8834 16.329 -326.66&lt;br /&gt;
- Sepal.Width   1    9.4353 23.881 -269.63&lt;br /&gt;
- Petal.Length  1   15.4657 29.911 -235.86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RによるPCA==&lt;br /&gt;
&lt;br /&gt;
主成分分析は prcomp という関数で実行します。&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; s &amp;lt;- prcomp(iris[1:4], scale=FALSE)&lt;br /&gt;
&amp;gt; biplot(s,xlabs = iris[,1])&lt;br /&gt;
&amp;gt; summary(s)&lt;br /&gt;
Importance of components:&lt;br /&gt;
                          PC1     PC2    PC3     PC4&lt;br /&gt;
Standard deviation     2.0563 0.49262 0.2797 0.15439&lt;br /&gt;
Proportion of Variance 0.9246 0.05307 0.0171 0.00521&lt;br /&gt;
Cumulative Proportion  0.9246 0.97769 0.9948 1.00000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
主成分 PC1 でほとんどの分散を説明できることがわかります。&lt;br /&gt;
プロットをみると、PC1は Petal.Width と Sepal.Width の寄与が大きいようです。またPetal.Length と Petal.Width が同じ内容を示すこと（ベクトルがほぼ同じ）がわかります。&lt;/div&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	</feed>