# Checking the regression model's performance

I am R-tool beginner. I have a question regarding how to know the performance of a linear regression model by using validation data. My approach was

1. Create training and validation data sets from original data set. "train" is name of my training data set and "valid" is name of my validation data set. "category" will be my target variable and "date_time" is my independent variable.

2. Use training data set to create a regression model

attach(train)

lreg=lm(category~date_time)

3. Now do predictions for validation data set using model created with training data set

p=predict(lreg,valid)

4. Now check the accuracy by finding the values of ACC, AUC.

mmetric(valid$category,p,"AUC") mmetric(valid$category,p,"ACC")

Now if AUC and ACC have small values then it means that model created by training data set is not good in making predictions.

Is my approach correct ?

Thanks and regards!

• Your questions are nearly entirely addressed at stats.stackexchange.com/questions/43310/… . – rolando2 Nov 16 '12 at 0:12
• Thanks for redirecting me. As per my understanding I think I am doing the correct thing in my question. creating a model with training data and doing prediction of validation data. Then calculating the performance. But I shall really appreciate it if someone could just answer in Yes or No so that I can be more certain. Regards – user16603 Nov 16 '12 at 22:02
• Please do not erase your question and replace it w/ something else. CV is intended to build a permanent repository of information about statistics via archived questions & answers. You are welcome to edit your Q and add updated info below the original question, but don't just erase what you initially asked. You may want to read our FAQ. – gung Dec 17 '12 at 0:47
• You might want to explain what your outcome is like. For example, are the 9 categories ordered? – Dimitriy V. Masterov Jan 16 '13 at 1:48