Practical Applications of Linear Regression in SAS - 2

9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.99
List Price:  €92.85
You save:  €27.85
£55.77
List Price:  £79.68
You save:  £23.90
CA$95.68
List Price:  CA$136.70
You save:  CA$41.01
A$105.96
List Price:  A$151.38
You save:  A$45.42
S$94.48
List Price:  S$134.98
You save:  S$40.50
HK$546.78
List Price:  HK$781.15
You save:  HK$234.36
CHF 63.33
List Price:  CHF 90.48
You save:  CHF 27.14
NOK kr761.11
List Price:  NOK kr1,087.35
You save:  NOK kr326.23
DKK kr485.02
List Price:  DKK kr692.92
You save:  DKK kr207.89
NZ$116.44
List Price:  NZ$166.35
You save:  NZ$49.91
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,660.01
List Price:  ৳10,943.35
You save:  ৳3,283.33
₹5,835.78
List Price:  ₹8,337.18
You save:  ₹2,501.40
RM331.75
List Price:  RM473.95
You save:  RM142.20
₦86,437.65
List Price:  ₦123,487.65
You save:  ₦37,050
₨19,492.21
List Price:  ₨27,847.21
You save:  ₨8,355
฿2,572.74
List Price:  ฿3,675.50
You save:  ฿1,102.76
₺2,264.43
List Price:  ₺3,235.04
You save:  ₺970.61
B$355.02
List Price:  B$507.19
You save:  B$152.17
R1,295.44
List Price:  R1,850.71
You save:  R555.27
Лв127.05
List Price:  Лв181.51
You save:  Лв54.46
₩94,909.58
List Price:  ₩135,590.93
You save:  ₩40,681.35
₪260.15
List Price:  ₪371.66
You save:  ₪111.51
₱3,993.87
List Price:  ₱5,705.78
You save:  ₱1,711.90
¥10,713.01
List Price:  ¥15,304.96
You save:  ¥4,591.95
MX$1,187.73
List Price:  MX$1,696.83
You save:  MX$509.10
QR254.83
List Price:  QR364.06
You save:  QR109.23
P950.82
List Price:  P1,358.38
You save:  P407.55
KSh9,247.76
List Price:  KSh13,211.65
You save:  KSh3,963.89
E£3,352.12
List Price:  E£4,788.95
You save:  E£1,436.83
ብር4,006.43
List Price:  ብር5,723.72
You save:  ብር1,717.28
Kz58,511.64
List Price:  Kz83,591.64
You save:  Kz25,080
CLP$65,950.47
List Price:  CLP$94,219
You save:  CLP$28,268.52
CN¥506.53
List Price:  CN¥723.65
You save:  CN¥217.11
RD$4,055.76
List Price:  RD$5,794.19
You save:  RD$1,738.43
DA9,420.16
List Price:  DA13,457.95
You save:  DA4,037.79
FJ$157.70
List Price:  FJ$225.30
You save:  FJ$67.59
Q542.52
List Price:  Q775.06
You save:  Q232.54
GY$14,601.52
List Price:  GY$20,860.22
You save:  GY$6,258.69
ISK kr9,773.40
List Price:  ISK kr13,962.60
You save:  ISK kr4,189.20
DH703.98
List Price:  DH1,005.73
You save:  DH301.75
L1,236.34
List Price:  L1,766.28
You save:  L529.93
ден3,998.26
List Price:  ден5,712.05
You save:  ден1,713.78
MOP$561.77
List Price:  MOP$802.57
You save:  MOP$240.79
N$1,291.99
List Price:  N$1,845.78
You save:  N$553.78
C$2,569.36
List Price:  C$3,670.67
You save:  C$1,101.31
रु9,319.09
List Price:  रु13,313.56
You save:  रु3,994.46
S/260.54
List Price:  S/372.22
You save:  S/111.67
K269.79
List Price:  K385.44
You save:  K115.64
SAR262.50
List Price:  SAR375.01
You save:  SAR112.51
ZK1,882.68
List Price:  ZK2,689.66
You save:  ZK806.98
L323.40
List Price:  L462.03
You save:  L138.62
Kč1,628.77
List Price:  Kč2,326.92
You save:  Kč698.14
Ft25,334.28
List Price:  Ft36,193.38
You save:  Ft10,859.10
SEK kr755.02
List Price:  SEK kr1,078.64
You save:  SEK kr323.62
ARS$61,468.17
List Price:  ARS$87,815.44
You save:  ARS$26,347.26
Bs483.33
List Price:  Bs690.51
You save:  Bs207.17
COP$271,845.87
List Price:  COP$388,367.89
You save:  COP$116,522.02
₡35,672.25
List Price:  ₡50,962.55
You save:  ₡15,290.29
L1,724.16
List Price:  L2,463.20
You save:  L739.03
₲522,510.75
List Price:  ₲746,475.93
You save:  ₲223,965.17
$U2,674.97
List Price:  $U3,821.56
You save:  $U1,146.58
zł281.37
List Price:  zł401.98
You save:  zł120.60
Already have an account? Log In

Transcript

In this video we will be discussing about the next part of the practical application of linear regression. That is, in our last video, we had done the tests for VA Watson tests certification test we are divided the data into two parts that is training and validation 70% training and 30% validation. Now we are going to In this video we are going to build a model using a training data and then we'll be able to apply the results of our training data into our testing data to check how robust is our technique so let's start it will be using the same procedure called proc reg data equals training model that hate equals lung cancer to Alzheimer's disease. So that red is my dependent variable and lung cancer. They will study from lung cancer to all our hidden variables. I will be doing selection equal structure nested r square because we'll be doing forward and backward selection to check which of the variables are significant.

In this code, we have executed the regression procedure on our training data, we are building our model based on the death rate which is our dependent variable and all the independent variables from lung cancer Alzheimer's disease are taken as independent variable we are doing backward and forward selection simultaneously based hospital justice is a selection equal to just harassment This is done to check which of the variables are actually significant for our model, and therefore, those variables will be used to build our model that is to creditor our dependent weights. So let's run this code. So, this is a result viewer. See, this is the report for you forward and backward selection, where the variables or the models are sorted in descending order of adjusted R squared r squared will be considering the value of adjusted R square then r squared because r square considers all the independent variables various Trotsky considers only the significant ones means that if you increase the number of independent variables you are asked for will increase because it is the ratio of extreme variation with total variation, but if the variables any of the variables which you have added or any of the labels which which are there new model are redundant then also the absolute value will be increasing.

So, that will not lead to a model efficiency therefore, we use the value of adjusted R square which is adjusted to the degrees of freedom. So, just transfer is r square value which is adjusted to the degrees of freedom. So, we'll be choosing that model which has got maximum value of adjusted R square. So, in this case the maximum value of adjusted R square is the model that is the first one which has got eight we will suggest r square is nearly 16.95% and ask for 73%. Obviously, we know that adjusted R square value will always be less than r square. So, we need these independent variables which we are going to use to predict our dependent variable.

Let me copy these independent variables So the independent variables that are significant for a model is lung cancer heart patients liver failure, tuberculosis, blood cancer oldish patients HIV, Alzheimer's disease out of so many independent variables only these are significant for our models, we'll be using this predictor dependent variable. So we'll be using the same procedure to predict a dependent variable for training data. So we'll be doing proper data cleaning, model method equals two we'll be using the variable names. prediction will be done in a different output data set. So therefore we're specifying output output equals to the name of the data set, say distraint. Read.

We can give any name to our data set, or data set, and P equals two predicted this key word is used. predictor dependent variable which is a threat over not run and then quit so let's run this code. So these are the parameter estimates are the coefficients of our model, this is the intercept coefficients, the rest of the slope coefficients of the regression coefficients of our model these parameter estimates will be using to predict the dependent variable current value for our validation data. So now First, let's check the value of our dependent variable for training data which is going to be given in frame rates the relative value of death rate for training data. So now let's find the correlation between the observed value and credit value of training data if the correlation is high. That means we can say that the our prediction is correct that is the opposite valid predicted value our training It is very close to each other.

So we are using the procedure called proc core data. What's your favorite market rate predicted and then run. So let's run this code. So the correlation is 0.85, which is quite tight. So you know that if the correlation coefficient values above point five, it's quite high. So since 0.85, so it's quite high.

That means that rated when the observed value are quite close to each other, so our prediction for 20 days more or less is correct. Now, let's predict the value of our dependent variable for our validation data. That prediction will be done in a different data set called data validation. underscore result. Set validation. This is my input data set, which is going to be get copied in validation on this resolved data set not predicted.

Equals we have to give the options values over here so I don't even need parameter estimates here a copy the conditions value first is may intercept. The next variable is lung cancer. pics video we just have patience. Next is liver failure. Then and then so let's run this code to get our take value up Insert the data set validation, validation result data set. This is great when you have Let's read for the validation data set 30% of the observations.

Now let's find the correlation between the observed value and the predicted value or validation, which is going to check, which is going to tell us how robust is our technique and how accurate is our prediction. So proc core data was validation underscore result raw data three predicted. So let's run this code 0.71. In our last case for training data, the original 0.88 just because we had built our model using a training data and then we had found the correlation between observing the record Please don't read it was 0.8 pips protesting obviously less than training. That's what is your open sign on which is also quite good 30 71% it's quite good admins a prediction for our testing days. Also correct.

And this is curious. This means we'll be doing this video for now. In my next video, we'll be discussing about producing correlations with the court procedure. Thank you. Goodbye. see you for the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.