How can I calculate the beta of a trend functions over several columns in SAS 9.3?
What's a beta? Is it the slope?
Can you provide more information, specifically, what does your data look like and what values you might expect.
yes, it is the slope. I have account information, and I would like to estimate how the amount changes over time in order to see if the account is active or not. So I have the account information distributed over sever columns according to the month.
I don't believe there's a single function to do that in SAS.
Other options that come to mind though are variance and checking the number of non missing.
good point!
But a bit disappointing for SAS - Excel offers this option.
Thank you!
What function? Slope?
You could transpose your data and run regressions if you were really interested.
The OP could try doing the regressions in PROC GLM. Supposing that the dependent variables are in columns 2 through N, and the independent variable in column 1, and that variables are named by column (e.g. COL_1, COL_2,..., COL_N), then I think the following will give what is needed:
proc glm data=datasetname;
model col_2 - col_n = col_1/solution;
quit;
If there is a desire to consider this as a multivariate analysis, that is pretty easy to gin up from here.
Steve Denham
Thank you very much - I will try this solution and let you know!
Bernard
OP, SAS indeed can find the Betas of your variables. This is an example of one of my regression models:
proc reg data=regress;
model cprod = year q2 q3 q4;
run;
So the 'cprod' is my dependent variable and year, q2, q3, and q4 are my independent variables.
The Betas are going to come through under the section Parameter Estimate along with some other useful stats (t values, p values, etc.)
If I had your variable names, I could be a little more helpful, but this is at least a good start to the Proc Reg capabilities.
Best,
Regulator
Hi Regulator,
my variables are:
BalanceDic BalanceJan BalanceFeb BalanceMar
and the idea is to estimate the slope of the trend.
Thank you very much and kind regards,
Bernard
So, my interpretation of your data and what you are trying to do with it is that you have account balances, and their corresponding months. Thinking about it, your goal would to see that a contributing month's Beta would be zero. Then if they are zero for several months in a row, you might be able to argue that an account is inactive, is that correct?
If so, do you have data for the entire year? if so, how familiar are you with collinearity and dummy variables?
Your interpretation is completely correct and I'm pretty familiar with collinearity and dummy variables.
But you would expect a different slope for every account, wouldn't you.
You can transpose your data and run regressions as I've mentioned above. So change your data to be like the following:
Account Month Balance
Then run a regression
proc reg data=have;
by account;
balance=month;
run;
Or I'm totally missing the point.
You are not missing the point! I will let you know if it worked.
at this moment we just took data for 4 month, but we could increase the numbers of the months.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.