Skip to main content
impriove grammar
Source Link

If I understand wellFirstly, you are talking about to use the function predict().

So you have theget your model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

Make sure all data values are correct.

The function predict() provide this usagedoes the calculation:

pred <- pred(your_model, your_data_test)

butYour issue seems that your_data_test have more variables than your model, right?

YouSo you can makeslice your_data_test and put into a new_data_test by using this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

and then

pred <- pred(yourmodel, new_data_test)

I suppose that this mayshould be works wellwork for you.

If I understand well, you are talking about to use the function predict().

So you have the model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

The function predict() provide this usage

pred <- pred(your_model, your_data_test)

but your_data_test have more variables than your model, right?

You can make a new_data_test using this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

pred <- pred(yourmodel, new_data_test)

I suppose that this may be works well.

Firstly, get your model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

Make sure all data values are correct.

The function predict() does the calculation:

pred <- pred(your_model, your_data_test)

Your issue seems that your_data_test have more variables than your model, right?

So you can slice your_data_test and put into a new_data_test by using

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

and then

pred <- pred(yourmodel, new_data_test)

I suppose should be work for you.

If i'm undertandI understand well, you are talking about to use the function predict().

So you have the model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

The function predict() provide this usage

pred <- pred(your_model, your_data_test)

but your_data_test have more variables than your model, right?

You can make a new_data_test followingusing this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

pred <- pred(yourmodel, new_data_test)

I suppose that this may be works well.

If i'm undertand well, you are talking about to use the function predict().

So you have the model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

The function predict() provide this usage

pred <- pred(your_model, your_data_test)

but your_data_test have more variables than your model, right?

You can make a new_data_test following this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

pred <- pred(yourmodel, new_data_test)

I suppose that this may be works well.

If I understand well, you are talking about to use the function predict().

So you have the model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

The function predict() provide this usage

pred <- pred(your_model, your_data_test)

but your_data_test have more variables than your model, right?

You can make a new_data_test using this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

pred <- pred(yourmodel, new_data_test)

I suppose that this may be works well.

Source Link

If i'm undertand well, you are talking about to use the function predict().

So you have the model:

LM <- lm(PSR ~ Area+Forests, data = Wetlands)

The function predict() provide this usage

pred <- pred(your_model, your_data_test)

but your_data_test have more variables than your model, right?

You can make a new_data_test following this,

new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)

pred <- pred(yourmodel, new_data_test)

I suppose that this may be works well.