2016-04-04 11 views
-1

を記録異なるカテゴリレベルの要因のテーブルを作成するには、私のコードは、テーブルを作成しようとしている。Rここでは線形モデル

table <- data.frame(expand.grid(
    health = factor(c("support", "oppose"), levels = c("support", "oppose")), + 
    information = factor(c("support", "oppose"), levels = c("support", "oppose")), + 
    gender = factor(c("male", "female"), levels = c("support", "oppose")), 
        count = c(76, 160, 6, 25, 114, 181, 11, 48))) 

Rはunexpected '=' after infoを言っています。私の教授はクラスでこのような例を示し、コードは機能しました。私は

答えて

0

+ Sを削除したデータの対数線形モデルをやろうとしている:

table<- data.frame(expand.grid(health=factor(c("support", "oppose"), 
levels=c("support", "oppose")), information = factor(c("support", 
"oppose"), levels=c("support", "oppose")), gender = factor(c("male", 
"female"), levels=c("support", "oppose")), count=c(76, 160, 6, 25, 114, 
181, 11, 48))) 

彼らはRコンソールでのコードのエコーを貼り付け/コピーから可能性がありますが、あなたの構文を取得エラー。

関連する問題