Programming the statistical procedures from SAS

Factor Analysis and Bartlett test

Accepted Solution Solved
Reply
Contributor
Posts: 37
Accepted Solution

Factor Analysis and Bartlett test

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

The LOGISTIC Procedure
Model InformationData SetResponse VariableNumber of Response LevelsModelOptimization Technique
WORK.PAPER2MAY2008 
WHtRatioCHANGE_IndicatorWHtRatioCHANGE_Indicator
2 
binary logit 
Fisher's scoring 

 

Number of Observations ReadNumber of Observations Used
412
412

 

Response ProfileOrderedValue WHtRatioCHANGE_Indicator TotalFrequency12
066
1346

Probability modeled is WHtRatioCHANGE_Indicator='1'.

 

Model Convergence Status
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.

 

PPPL1Satfat_2005 =PPPL2N3VLCAA_2005 =PPPL3n62dbond_2005 =PPPL4DGLAadreDPA_2005 =PPPL5MUFA_2005 =PPPL6ALA_2005 =
0.01614 * Intercept
1.05307 * Intercept
-0.45272 * Intercept
0.58611 * Intercept
-0.25506 * Intercept
-0.19288 * Intercept

 

Analysis of Maximum Likelihood EstimatesParameter DF Estimate StandardError WaldChi-Square Pr > ChiSqInterceptPPPL1Satfat_2005PPPL2N3VLCAA_2005PPPL3n62dbond_2005PPPL4DGLAadreDPA_200PPPL5MUFA_2005PPPL6ALA_2005
11.65680.1343152.1439<.0001
00...
00...
00...
00...
00...
00...

 

 

 

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

 


Accepted Solutions
Solution
‎05-29-2018 08:18 AM
Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

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 meSmiley Wink.

 

Thank you, Rick and SAS community. 

 

Very kind regards

 

 

 

 

View solution in original post


All Replies
Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

Hello everyone, please say something. Please. 

SAS Super FREQ
Posts: 4,245

Re: Factor Analysis and Bartlett test

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?

Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

Thank you Rick. Let me try this and get back to you. Very kind regards.
Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

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

Obs PPPL1Satfat_2005 PPPL2N3VLCAA_2005 PPPL3n62dbond_2005 PPPL4DGLAadreDPA_2005 PPPL5MUFA_2005 PPPL6ALA_200512345678910
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0

 


The SAS System_not log tarsnfromed

Obs PPPL1Satfat_2005 PPPL2N3VLCAA_2005 PPPL3n62dbond_2005 PPPL4DGLAadreDPA_2005 PPPL5MUFA_2005 PPPL6ALA_200512345678910
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0
01-01-0-0

 

Thank you. Looking forward to hearing from you.

Very kind regards

 

 

 

SAS Super FREQ
Posts: 4,245

Re: Factor Analysis and Bartlett test

> 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.

Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

Dear Rick, Thank you for your feedback.
N otice that I also checked the data with non transformed variables and
they also showed zero and negative.(second table). The funny thing is I can
do the logistic regression in SPSS and am getting results but not with SAS.

Anyway let me start the process once more with original data set. I will be
back here with feedback.
Thank you very much.
Very kind regards.
Solution
‎05-29-2018 08:18 AM
Contributor
Posts: 37

Re: Factor Analysis and Bartlett test

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 meSmiley Wink.

 

Thank you, Rick and SAS community. 

 

Very kind regards

 

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 248 views
  • 2 likes
  • 2 in conversation