訂正;hetcor関数のこと

データはデータフレーム型で与えねばならないみたい。で、factorに指定されてあったら、ordinalと見なすようです。
サンプル・プログラムをあげておきます。

<span class="synComment">#データフレーム形式でデータをつくる</span>
<span class="synComment">#前から順に、二件法、三件法、四件法、、、七件法のつもりで適当に作ったデータ。</span>
data <span class="synStatement">&lt;-</span> <span class="synType">data.frame</span><span class="synSpecial">(</span><span class="synType">matrix</span><span class="synSpecial">(</span>c<span class="synSpecial">(</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">5</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">6</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">5</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">6</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span>
<span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">0</span><span class="synSpecial">,</span><span class="synConstant">3</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">4</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">5</span><span class="synSpecial">,</span>
<span class="synConstant">1</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">2</span><span class="synSpecial">,</span><span class="synConstant">5</span><span class="synSpecial">,</span><span class="synConstant">2</span>
<span class="synSpecial">),</span>ncol=<span class="synConstant">6</span><span class="synSpecial">,</span>byrow=<span class="synConstant">TRUE</span><span class="synSpecial">))</span>
<span class="synComment">#変数名をつけておく。grade2〜grade7</span>
colnames<span class="synSpecial">(</span>data<span class="synSpecial">)</span> <span class="synStatement">&lt;-</span> c<span class="synSpecial">(</span><span class="synConstant">&quot;g2&quot;</span><span class="synSpecial">,</span><span class="synConstant">&quot;g3&quot;</span><span class="synSpecial">,</span><span class="synConstant">&quot;g4&quot;</span><span class="synSpecial">,</span><span class="synConstant">&quot;g5&quot;</span><span class="synSpecial">,</span><span class="synConstant">&quot;g6&quot;</span><span class="synSpecial">,</span><span class="synConstant">&quot;g7&quot;</span><span class="synSpecial">)</span>
<span class="synComment">#四件法以下は水準(factor)だと考える</span>
data$g2 <span class="synStatement">&lt;-</span> as.factor<span class="synSpecial">(</span>data$g2<span class="synSpecial">)</span>
data$g3 <span class="synStatement">&lt;-</span> as.factor<span class="synSpecial">(</span>data$g3<span class="synSpecial">)</span>
data$g4 <span class="synStatement">&lt;-</span> as.factor<span class="synSpecial">(</span>data$g4<span class="synSpecial">)</span>
<span class="synComment">#ライブラリのインストール</span>
library<span class="synSpecial">(</span>polycor<span class="synSpecial">)</span>
<span class="synComment">#あの関数</span>
hetcor<span class="synSpecial">(</span>data<span class="synSpecial">)</span>