If you have matrix, you may want to look at IML.
Otherwise, post a sample of what your data looks like.
Unless your matrix is Nx1, it's likely your data structure will support GLM.
Could you describe your data further? How does the matrix enter into the model?
Are your matrices SAS data sets - .sas7bdat files?
No. It is a csv file.
Please post a sample of your data. I think you can use proc glm.
I attached the data. There are 20 samples and 55 variables in the data. here is the output: Many thanks.
8.14 | 5.77 | 5.89 | 4.78 | 4.48 | 3.96 | 5.1 | 5.57 | 5.27 | 4.2 | 5.23 | 2.94 | 4.77 | 4.67 | 4.8 | 5.21 | 5.28 | 3.91 | 4.21 | 5.17 |
This is how the code could look, if you wanted a simple GLM model:
*import dataset into SAS;
data have;
infile 'C:\_localdata\data.csv' dlm="," dsd truncover lrecl=1000;
informat var1-var40 best32.;
format var1-var40 best32.;
input var1-var40;
run;
*Run model;
proc glm data=have;
model var1 = var2--var40;
run;quit;
Many thanks for your response. I have some questions for you. Where is the output variable 'y'. Also why did you take 40 variables is there a specific reason for that?
Your file had 40 variables, it was a demo of how it could be accomplished.
It had no headers so I don't know which is y, which is x etc.
I simply took the first variable as the Y and the remaining as X to demonstrate the GLM procedure.
To develop a final model you might want to use a selection method to subset the variables. PROC GLMSELECT is helpful here.
Please consider my code a sample, not what you should do. You should know what your variables are and how they should be handled.
Many thanks for your response I understood you mean.
My bad. Mistakengly I put 55*40 input. It should be 55*20 but I see you mean. The 40 is the sample number. I do have 55 variables so is the following right?
proc glm data=have;
model y = var1--var55;
run;quit;
I don't now what GLMSLECT is doing at the final stage. I will research for it. Many thanks for your responses.
You had 55 observations, not variables.
The columns are variables not rows
In general, your code looks correct, assuming that matches your data structure.
Thank you so much so I need to transpoze my data in order to make right model. Many thanks.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.