特定の方程式の重回帰を使用して回帰係数を計算しています:
w=c(1,5,4,5,4,8,7,9,2,4,5,7)
g=c(1,5,2,5,4,8,7,9,3,5,6,6)
k=c(1,5,2,5,4,8,7,9,2,4,5,7)
m=c(1,5,2,5,4,9,8,10,3,5,6,8)
#w=a+bg+b1k+b2m : simple equation
model1=lm(w~g+k+m)### worked fine
#w=a+b(log(1-g/m))+b1k+b2m :my real equation
model2=lm(w~(log(1-k/m))+k+m)
エラー:
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'x'