I am doing factor analysis.
I developed a problem when deriving patterns. I could not get the KMO,
I, therefore, transformed my data and managed to derive 6 fatty acid patterns and got a KMO of 7.8.
I have named them as follows.
PPPL1Satfat_2005
PPPL2N3VLCAA_2005
PPPL3n62dbond_2005
PPPL4DGLAadreDPA_2005
PPPL5MUFA_2005
PPPL6ALA_2005
However, I could not the Bartlett test for sphericity
This is the results I am getting.
All observations in data set WORK.ALICEPAPER1MAY2018 have missing values, or the sum of
weights or frequencies is nonpositive.
Well, I went ahead and did some analysis.
In linear regression, I got my results, i.e association with weight, BMI and Waist circumference and etc. (this was cross-sectional).
Now I am doing longitudinal analysis with the same patterns and running a logistic regression
I am getting this statement "SAS Output
Note: | The following parameters have been set to 0, since the variables are a linear combination of other variables as shown. |
SAS Output
The SAS System |
Maximum Likelihood Factor Analysis with One Factor |
WORK.PAPER2MAY2008 | |
WHtRatioCHANGE_Indicator | WHtRatioCHANGE_Indicator |
2 | |
binary logit | |
Fisher's scoring |
412 |
412 |
0 | 66 |
1 | 346 |
Probability modeled is WHtRatioCHANGE_Indicator='1'. |
Convergence criterion (GCONV=1E-8) satisfied. |
Note: | The following parameters have been set to 0, since the variables are a linear combination of other variables as shown. |
0.01614 * Intercept |
1.05307 * Intercept |
-0.45272 * Intercept |
0.58611 * Intercept |
-0.25506 * Intercept |
-0.19288 * Intercept |
1 | 1.6568 | 0.1343 | 152.1439 | <.0001 |
0 | 0 | . | . | . |
0 | 0 | . | . | . |
0 | 0 | . | . | . |
0 | 0 | . | . | . |
0 | 0 | . | . | . |
0 | 0 | . | . | . |
These are the codes
*model 1;
proc logistic data=PAPER2MAY2008;*plasma FA;
model WHtRatioCHANGE_Indicator (event='1')= PPPL1Satfat_2005 PPPL2N3VLCAA_2005 PPPL3n62dbond_2005 PPPL4DGLAadreDPA_2005 PPPL5MUFA_2005 PPPL6ALA_2005 / rsq lackfit ;/*put the model in this form -> response = predictors*/
run;quit;
*model 2;
proc logistic data=PAPER2MAY2008;*plasma FA;
class Gender_Code_2005;*put categorical variables here*/;
model WHtRatioCHANGE_Indicator(event='1')= PPPL1Satfat_2005 PPPL2N3VLCAA_2005 PPPL3n62dbond_2005 PPPL4DGLAadreDPA_2005 PPPL5MUFA_2005 PPPL6ALA_2005 Age2005 Gender_Code_2005 / rsq lackfit;/*put the model in this form -> response = predictors*/
run;quit;
Please help,
Bartlett test for sphericity and these results are related?
Worried PhD student.
Kind regards
Dear Rick,
You won't believe it.
I found out what the problem was. I created the problem during data merging process. The merging method created zeros and negative numbers so, not only in the fatty acid patterns but other varaibles too.
I used a longer method and the data is fine and I can do my logistic regression and correlations and get results.
It cost me a whole 6 good days.
Lesson learned: Check the data in every step to make sure there is no distortion, especially for SAS juniors like me.
Thank you, Rick and SAS community.
Very kind regards
Hello everyone, please say something. Please.
I think the procedure is telling you that the variables are identical. perhaps the transformation you used has an error. Try running
proc print data=PAPER2MAY2008(obs=10);
var PPPL: ;
run;
Are the variables different and nonmissing?
Dear Rick, to my surprise, the numbers are all 0, 1 or negative, for both log transformed and not log transformed. What could have happened?
I have no idea what to do from here. Please help.
But how come, I was able to perform analysis with linear regression, but just realised this problem with logistic regression?
SAS Output- Log transformed
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
The SAS System_not log tarsnfromed |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
0 | 1 | -0 | 1 | -0 | -0 |
Thank you. Looking forward to hearing from you.
Very kind regards
> the numbers are all 0, 1 or negative
> What could have happened?
> I have no idea what to do from here. Please help
I do not know what might have happened, but I suggest you look at your original (untransformed) data. Before beginning any analysis, you should run some simple univariate analyses. For example, if your original variables are X1, X2, X3, ..., you can run PROC UNIVARIATE to look at descriptive statistics (mean, median, standard deviations) and distributions (histograms):
proc univariate data=have;
var x1 x2 x3 x4 x5;
histogram x1 x2 x3 x4 x5;
run;
I do not know why you chose to log-transform your data. Unless there is a compelling reason, you might try to run the analysis by using the original variables.
Dear Rick,
You won't believe it.
I found out what the problem was. I created the problem during data merging process. The merging method created zeros and negative numbers so, not only in the fatty acid patterns but other varaibles too.
I used a longer method and the data is fine and I can do my logistic regression and correlations and get results.
It cost me a whole 6 good days.
Lesson learned: Check the data in every step to make sure there is no distortion, especially for SAS juniors like me.
Thank you, Rick and SAS community.
Very kind regards
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.