我正在使用多元回归计算特定方程的回归系数:
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'