idl programming language - How LINFIT in IDL is represented in R? -
i have code written in idl want convert r.
within code found function:
result = linfit(dum_x, dum_y) y_a= result[0] y_b= result[1] "linfit function" fits paired data { xi , yi } linear model, y = + bx, minimizing chi-square error statistic
i wonder if there similar function in r? ideas how can convert line r :
y_a= result[0]
my guess is
result <- lm(dum_y~dum_x) y_a <- coef(result)[1] y_b <- coef(result)[2]
but don't have access idl can't check ... give reproducible example idl/linfit results ...
Comments
Post a Comment