Answers for "predict in r"

R
0

how to make predictions in r

predict(object = your_model, newdata = your_test_data)
Posted by: Guest on April-26-2020
0

predict in r

# Tmod, Tamb and GI are columns in the data frame data2
# Find the k coefficient to complete the equation
Model_Tmod <- nls(Tmod ~ Tamb + k * GI, data = data2, start=list(k=1))

k = coef(Model_Tmod)
And where ever there is an NA in Tmod column it gets filled with the predicted
data2$Tmod[is.na(data2$Tmod)] = data2$Tamb[is.na(data2$Tmod)] + k * data2$GI[is.na(data2$Tmod)]
Posted by: Guest on July-31-2020

Browse Popular Code Answers by Language