Posts tonen met het label mplus. Alle posts tonen
Posts tonen met het label mplus. Alle posts tonen

woensdag 31 augustus 2011

Factoranalyse

Een zeer korte handleiding voor factoranalyse:

Waarom factoranalyse

Factoranalyse is een datareductiemethode, waarbij gezocht wordt naar latente variabelen die een set van variabelen samenvatten. Het vertrekt daarom van de correlatiematrix van deze geobserveerde variabelen.

Voorbeeld: leerlingen leggen op het eind van het jaar twaalf testen af. Een exploratieve factoranalyse zou aan het licht kunnen brengen dat dit eigenlijk slechts drie vaardigheden toetst.

  1. Taalvakken: Nederlands, Frans, Engels, Duits
  2. Analytische vakken: wiskunde, natuurkunde, scheikunde, logica
  3. Kennisvakken: geografie, biologie, geschiedenis, esthetica
Een confirmatorische factoranalyse werk op de omgekeerde manier: 

Let op!


  • Controleer eerst de correlatiematrix: enkel variabelen die een correlatie boven .30 met andere variabelen hebben dienen te worden weerhouden.
  • Gebruik geen factoranalyse als de correlatie tussen variabelen niet aan een latente factor te wijten is maar bijvoorbeeld aan de distributie van de populatie op irrelevante kenmerken.

Scree plot



Assumpties
Dezelfde als voor correlaties: normaal verdeelde, continue variabelen. Heb je ook of enkel ordinale of binaire data, dan moet je vluchten naar polychorische principale componentenanalyse (het trage en onoverzichtelijke polychoricpca in Stata of de complexe explorative factoranalyse in Mplus).

Eigenwaardes
Als een vuistregel gebruikt men Kaisers criterium (Kaiser's criterion) dat zegt dat eigenwaardes groter dan 1 moeten zijn. Alternatief kan je kijken naar relatieve sterke dalingen van de eigenwaarde, naar de cumulatieve voorspelde variantie, naar de factorsterkte (Mplus: > .9) of naar bepaalde significantiematen (Mplus: RMSE). 

Rotatie
Om de geobserveerde variabelen te scoren op een bepaalde matrix zijn er verschillende mogelijkheden. Orthogonale rotaties of oblique rotaties. Voor zover ik het begrijp zijn de dimensies in een orthogonale rotatie niet gecorreleerd (denk aan een kruis met rechte hoeken), terwijl dit in oblique rotaties wel het geval is (een kruis met scherpe en stompe hoeken). De vergelijking met kruisen gaat natuurlijk enkel op in twee- of driedimensionele omgevingen. De richting van de rotatie wordt bepaald door de te maximaliseren of minimaliseren afstand:
  • Varimax: maximaliseert per factor de variantie van de ladingen op deze factor
  • Quartimax (~oblimax): maximaliseert per variabele de variantie van de ladingen op de verschillende factoren
  • Geomin (Mplus), oblimin, equamax, ...
Er zijn slechts vuistregels omtrent de interpretatie van de factorladingen. Vanaf .400 en zeker vanaf .600 spreken we van hoge ladingen, al hangt het telkens af van de rotatiemethode.
Links
Yahoo Answers: What are difference between varimax, quartimax and equamax rotation in factor analysis? - http://answers.yahoo.com/question/index?qid=20080616044600AAnsCc4

donderdag 29 juli 2010

What stats package to use?

Introduction

Boys like their toys, and this is not different with statistical packages. It's a perpetual and heated debate and when you've landed at some point and think your workflow is good, technology passes you and sets you back. 

Here's an old discussion that I first consulted, but below I make my own considerations. In short: I'd use Python for big data, Stata for analysis, and R if I have to (e.g. for some graphs). Everything else I would ditch.

Stata

Stata is my program of choice. It is quite expensive, but mind you that for a couple of hundred euros, depending on the flavour, you'll not only get an easy and robust statistical software package, but also fast support, a good community, useful user commands, and a great documentation source. Fun fact: all documentation is read by the wife of the founder, who's not a statistician but perhaps even smarter. If she doesn't understand what the statisticians are saying, it goes back to the drawing board. 

The bad things: forget about ever copy-pasting anything. You'll also need to have a lot of memory on your computer, as Stata loads the whole file and just one at a time (although you can 'preserve' a file temporarily to work on something else in between).

Python

Python is the next language I will learn. I have used chunks without understanding what I was doing, but I like the sound of the language, and it's the logical step-up after Stata, it seems. Many people are using it and so will I.

R

I don't like R. There is a thorough discussion here, circling around leaving Stata for R, but ending up in concluding what I conclude about: R is a mixture of a coding language like Python and a statistical language like Stata, but because it is open source the support is unsure, the community tends to be geeky and unfriendly, the documentation is poor, and the language consistency - even if the structure is good because it is a programming language - is bad. Some commands have their own inner programming language and that is plain bad. 

The good things: it is free and R Studio is a great user interface. It has good graphic capabilities, and 

Mplus

I don't know Mplus. Colleagues use it when there are issues with missing values, and the programmers are said to be the best statisticians in the world. So it must be good, but I don't use it.

SAS

This is old software. It is too complicated, and while it can do a lot through obscure options, it is not flexible enough to do what you want.

SPSS

This is bad software. It is a scandal that some universities still teach this.

Some R resources

Apparently the single best manual for R: https://r4ds.had.co.nz.