|
Dear members,
I was hoping someone can help to solve the following programming problem.
I am running a regression procedure (Proc PHREG, specifically) and saving
coefficients of the regression model in the file, e.g. lib.estim,
I would like to calculate the predicted value on another data set, eg.
lib.data, using those coeficients.
So lib.estim has the following structure,
var1 var2 var3 var4
0.1 0.2 0.3 0.4
where varI is the name of the predictor variable and 0.1 etc is the
corresponding regression coefficient estimate
And lib.data :
var1 var2 var3 var4
1 3 4 5
2 3 6 7
..................
8 9 10 11
where varI is again the predictor name and the variable values are the
predictor values.
The simplest and extremely time consuming way is to calculate predicted
value by typing in the coefficients in the equation by hand.
data lib.data;
pred=0.1*var1+0.2*var2+0.3*var3+0.4*var4;
run;
The problem is that I will have to do it dozens of times and I have over
40 predictors. My suspicion is that one has to use arrays and macro
language to somehow use the data from one data set in another, but I am
not familiar enough with to find the right approach.
Any help, directions, references will be greatly appreciated,
Thank you very much in advance
Maria
------------------------------------------------------------
Maria Stepanova 50 George Square
PhD student @ Edinburgh EH8 9JY
Department of Business Studies UK
University of Edinburgh tel: +441316504644
------------------------------------------------------------
|