My doctoral advisor, the late, great Dr. Eyman, used to  tell me that my psychometric theory lectures were,

A light treatment of a very serious subject.

Hmph. Well, with all due respect to a truly wonderful mentor, I still have to state unequivocally that the majority of students when looking at a factor analysis for the first (or second or third) time are thinking more like the title of this post.

Several days  ago,I described how to point and click your way through factor analysis so that you got a bunch of output. Now what?

The questions to answer are:

  • What exactly is a factor anyway?
  • How many factors are present in these data?
  • What does each factor that you extracted represent?

Conceptually, a factor is some underlying trait that is measured indirectly by the items you measured directly. For example, I want to measure a factor of  “mathematical aptitude”. So, I ask a bunch of questions like, “What is 7 x 6?” and “If two trains left the station at the same time, going 100 miles an hour in opposite directions, how far apart would they be 45 minutes later?” I’m really not that interested in your ability to answer that specific question about trains.

Factor analysis is also referred to as a ‘dimension reduction technique’. It’s much simpler to understand a relationship between, say college GPA and two factors of  quantitative aptitude and verbal aptitude than to explain the correlations among 120 separate questions and college GPA.

The measures could be anything – test scores, individual items on a test, measurements of various dimensions like height or weight, agricultural measures like yield of a rice field or economic ones like family income. You’re factor analyzing a correlation matrix of these neasures (if your input data set was not a correlation matrix, it’s going to be transformed into one before it’s analyzed). Correlations are standardized to have a variance of 1.

One thing you want to look at is the eigenvalues. An eigenvalue is the amount of variance in the individual measures explained by the factor.  (If you don’t believe me, square the loadings in the factor pattern and add them up. The total is the eigenvalue. Prediction: At least one person who reads this will do exactly that and be surprised that I am right. Contrary to appearances, I do not make this shit up.) So if the eigenvalue is 1.0 it has explained exactly as much variance as a single item. What good is that? It would take you 42 factors with an eigenvalue of 1.0 to explain all of the variance in a set of 42 measures. You’re not reducing the dimensions any. For that reason, a common criterion for deciding the number of factors is “Minimum eigenvalue greater than 1.”

The problem is, and it has been documented many times over, this criterion, although it is the default for many software packages, tends to give you too many factors. I prefer two other methods. My favorite is the parallel analysis criterion which does many iterations of analysis of a dataset of random numbers. The idea is you should get factors that explain more than if you analyzed random data. There is a useful SAS macro for doing that.

Or … you can just look at a scree plot, which, although not quite as accurate involves no more effort than staring. Here is my scree plot from the 42 variables I analyzed from the 500 family study. As every good statistician (and Merriam-Webster ) knows, scree is ” an accumulation of loose stones or rocky debris lying on a slope or at the base of a hill or cliff”. The challenge is to distinguish which factors should be retained and which are just showing small random relationships among variables, like the bits of rubble.

Clearly, we want to keep our first factor, with an eigenvalue of 7.3. Our second, with an eigenvalue of 3.3 looks like a keeper as well. So-o-o , do we take the third factor with an eigenvalue of 2.2 or do we say that is just part of the scree-type random correlations? I’m saying we keep it. Were you hoping for something more scientific? Well, I guess you’re disappointed, then.

scree

 

 

By the way, if we used the minimum eigenvalue of 1 criterion that would give us 12 factors which is just ridiculous. Liau et al. (2011) in  a very serious paper for SAS Global Forum suggest not having less than 50% of the variance explained. That would mean your eigenvalues you keep add up to 21 at least, and not the 12.8 we have here (7.3 + 3.3 +2.2). To do that, instead of cutting the factors at our plot at 3, which I have so helpfully labelled Point A, we would instead cut it at Point B.

What we are doing now is an exploratory factor analysis so I am going to do this:

1. Based on my scree plot request a 3-factor solution.

2. Inspect the factor pattern and see if that makes sense to me based on expertise in the content area which I am going to pretend to have. (Actually, if you’re familiar with Baumrind’s work, it is looking a bit like the control / warmth factors that she postulated so I am not completely pulling this out of my — um, head.)

3. Run the parallel analysis macro and see the number of factors recommended by that.

Check back here next time I can get some time away from my day job writing computer games to pontificate on analysis of random data. Hopefully, that will be tomorrow because our (relatively) new Chief Marketing Officer is going to the women entrepreneur meet-up in Pasadena instead of me because I’d rather write about Kabacoff’s parallel analysis macro.  And THAT is why I hired someone to do marketing.

It all comes down to one word:

Perseverance.

Yesterday was the first time I got to read my dossier for the 40 women to watch over 40. In it was a quote from someone who had nominated me:

“I think that perseverance is key to her success.”

The tagline from my interview that just aired with Real Talk/ Real Women said,

“The big difference in making things happen is: you just keep doing it.”

Clearly, the impression I leave is consistent. It’s also accurate. As I worked on the programming for our second game this week, I thought, I know there are better programmers than me, people who have a lot of really elegant solutions I would not have thought of. My success comes from just not giving up and lots of old-fashioned hard work.

meetup_poster_backTwo things I learned from sports still apply to my life today running a business. The first is that variety is good. When I was tired of practicing drills in judo, I could go out and run track. I was on my college track team and the U.S. judo team at the same time. When I was exhausted from working out,  I studied, and when I was bored studying, I went and worked out.

Last week, I made pretty good progress on game 2, worked on it A LOT. Then we drove to Las Vegas and had a meet-up with our Kickstarter backers and representatives from different school districts. (Thank you so much to everyone who came.)

meetupToday, I went back to working on the coding, got frustrated with some code that should work but doesn’t and after a few hours did one of the problem videos as an example for three of my collaborators who are doing voiceover and animation so they have a tangible model. When that was done, I wrote this blog.

The second sports lesson is a line from track coach:

Champions always do more.

When I was competing, I would try to get to practice 15 minutes early and knock out 50 or 100 repetitions of an arm bar or some other drill. I’d try to stay 15 minutes late and do the same thing. In my conditioning workout, I always tried to run an extra mile after I was tired, do an extra set at weightlifting, in some way get in at least another 10 minutes. Even if I only did this six days out of seven, and 50 weeks out of 52 and only for the last ten of the 14 years that I competed, those minutes came up to an extra 2,000 hours of training. And thus are world championships earned.

Every night when I am thinking about knocking off, I try to finish one more thing. Tonight it is a conference paper I am working on for the Turtle Mountain Disability conference in October. It will be their first time holding it and I’m really excited about the topic, “I’m from the Internet and I’m here to help (people with disabilities)”

After that, I’ll work for a bit on my paper on factor analysis for the Western Users of SAS Software meeting in November.

So, those are numbers 43 and 44 of 55 things that I have learned in (almost) 55 years – the secret of success is doing more, and when you are tired, just do more of something else.

 

 

Every time something annoys me, I take it as a learning experience. For example, Darling Daughter Number Three has been remiss at getting back to me lately, with the lament,

“But I’m SO busy!”

I understand she just finished filming a TV show and has people line up for hours to get her autograph, etc.

OLYMPUS DIGITAL CAMERA

 

On the other hand, if she gets in a bind, I’m always the first person she calls. As I grumbled to The Invisible Developer, “We make time for things that are important to us.”  I realized that I was just as guilty.

What is important to me is getting everything lined up for our game demo in Las Vegas on Friday. It’s just a small get-together game demo but it’s the first one we’ve done so I want it to go off perfectly. Finishing the second game, revising the first game, getting contracts out to the people we are hiring are all important to me.

It occurred to me that other things are important to the clients we already have, like their quarterly reports, progress on meeting in-kind match requirements. To other members of our staff, their travel arrangements for various meetings are important, getting their business cards ordered, getting put on the payroll – all of which I have  to review and approve. So, I’ve been trying to make a sincere effort to devote more attention to those other responsibilities that matter to other people, reminding myself that those PEOPLE are important to me and helping each other is, by definition, a two-way street.

Last week, I tried to contact a vendor about an order we had that they completely screwed up – as in, objects showed up broken into a large number of pieces that are supposed to come in one piece – and no one was in their office after 5:30 pm. There wasn’t even a voice mail option to leave a message! This made me wonder about our customer service. If people contact me directly, I get right on it or see that someone else does. However, we did a survey of our Kickstarter backers asking if they’d had a problem installing the game. Very few did and most of them tweeted about it or in some way attracted my attention and I contacted them. I asked if we had followed up with each person who mentioned on the Kickstarter survey having a problem. It turned out we did not – so, if you received an email this week, that’s because we went back and followed up with each person.

You know that rule about

“Do Unto Others as You’d Have Them Do to You”

(Yes, I know that text color is purple, not gold, but gold wouldn’t really show up, now would it?)

Whenever someone is a jerk to me or some business pisses me off, I try to ask myself,

“Do I ever do that? Could our customers/ employees/ vendors ever feel that way about me or our company?”

and if the answer is, “Yes” (more often than I’d like to admit), then I try to fix it. The worse they are, the more ways I can see that we DON’T want to be like them. In that way, even if you are a complete ass and your company sucks, maybe we benefited from dealing with you.
==============================================
Learn math. Save lives. Learn culture. Kill animals. (Relax, it’s a game.)

7 Generation Games Logo with feathers


When I first went to graduate school in the 1970s (yes, for my MBA, in 1978) , if one were to comment casually,

“And then I factor-analyzed the correlation matrix to solve that problem.”

Everyone would say,

“Ooooh.”

Back in those days before statistical calculators (forget the Internet), when computers only came in big (really big) blue boxes and SAS probably was still compiled on punched cards and your department had to  pay for computer time, you did it by hand if you were a broke graduate student. Yes, I mean literally with a pencil in your hand. First, you computed the correlations between each of the items and then you applied some equations you can find in any detailed book on factor analysis, which I had forgotten and then looked up again in the documentation here. It doesn’t matter anyway because no one does it that way any more.

Since I had SAS Enterprise Guide open, I just pointed and clicked my way through. First I clicked on the data set I had opened and then went to the TASKS menu, pulled down to MULTIVARIATE and then CORRELATIONS.

corrfactor1

Next, I just clicked on the variables I wanted to use in my analysis and clicked the blue arrow in between panes of the window to select them as my analysis variables. You can also shift-click to select a bunch at once. Don’t click RUN yet!

corrfactor2

 

You need to output the correlation matrix as a SAS dataset of type= CORR. Fortunately, that is super-duper easy. You just click in the far left pane on the option that says OUTPUT DATA. Then click in the box next to SAVE OUTPUT DATA . Now you can click RUN.

corrfactor3

 

Now that you have a correlation matrix, you can go ahead and factor analyze it just like you did before. Click here if you don’t remember.

Note that

“The data set created by the CORR procedure is automatically given the TYPE=CORR data set option, so you do not have to specify TYPE=CORR.”

I’m pretty sure this was not always the case, but according to the SAS documentation, it is now. So, now that you have your input data set, you just click on it, go to TASKS > MULTIVARIATE > FACTOR ANALYSIS like before and there you have it.

But …. what exactly do you have? Check back here for my next post titled (I am not making this up), “What’s all that factor analysis crap mean, anyway?”
=================================================

Learn math. Save lives. Learn culture. Kill animals. (Relax, it’s a game.)

7 Generation Games Logo with feathers

 

Yeah, speaking of killing animals, The Perfect Jennifer is quite upset about shooting the buffalo in the game as she is a vegetarian and extremely soft-hearted even about shooting virtual animals. She asked Dr. Longie, our Dakota cultural consultant, didn’t they have vegetarians back in the day.

He said, “Yes, the Dakota had people who didn’t eat meat. We called them ‘Bad Hunters’.”

Dr. Longie

 

 

I was working on something for a client when The Invisible Developer walked into my office, looked over my shoulder at the code and said,

“So, you’re a PHP programmer now?”

I answered,

“I’m a whatever-language-we-happen-to-need-at-the-moment programmer.”

A year and a half ago, I took a look at Codecademy and was underwhelmed. It’s gotten mixed reviews and if you find it awesome, good for you.

One of the drawbacks I saw is that it didn’t reflect  the way I think most software is actually written.

A big complaint even people who liked Codecademy had was about the console. When I was an undergraduate taking my first couple of programming classes I did nice little things like their program to calculate taxi cab fares, or tips or whatever it was.

Now I make things that people actually use and it’s a lot more complicated. In doing that, there are some tools that make my life so much easier. There are three broad types of extraordinarily useful tools.

DE-BUGGING

XAMPP – if you are going to be doing anything with PHP and MySQL, take the time to download and install this. It’s free.  At first, I thought it was wasted effort because why do I want to go to the trouble to create an extra copy of the same SQL tables on my desktop. At first, I was an idiot. Here’s the deal, you can have your SQL database on your server, upload your files to run them and test them, or you can have it on your desktop and test it locally. Of course I don’t have the entire database on my desktop, just tables with the same columns and some fake data. It’s much, much quicker and easier to find errors than going through the whole uploading the file, finding an error, fixing it, uploading it again. Just install the damn thing and quit whining. I have had zero problems, zero complaints and cannot believe I didn’t do this on day one.

Some type of Integrated Development Environment (IDE), I use Webstorms, but there are plenty of others out there. Any IDE is going to include a source code editor,debugger and most have intelli-sense, which will try to automatically sense what you are planning to type and offer to complete it for you. Kind of like your iPhone but it works much better since there is a much smaller subset of words. It will identify if you have left off a closing bracket, parentheses, semi-colon, etc., let you know if you are deleting a file referenced in another file and stuff like that.

 Developer tools – just about any browser will come with a set. I like Safari’s the best but I use Firefox almost as often, and sometimes Chrome. These usually include an error console that will show you any errors, a view to look at the source code including scripts being called by your web page.

You might notice what all of these have in common are de-bugging. If you’re making anything that’s more than a bit complex, you’re going to spend a great deal of your time de-bugging, probably a lot more time than you spend writing code.

I think I’m pretty typical. Normally, I write a first draft that doesn’t run. Then, I swear and find whatever bugs are there. Depending on how complicated the project is, this may take a while during which progress is defined as finding bugs further down in the code. My second draft runs but is not very elegant. It could be more secure, more efficient, use macros, whatever, but it runs. I often post my second draft on my blog where nice readers who post comments and suggestions (which I DO appreciate and I no doubt don’t say THANK YOU enough) probably wonder how I stay employed writing stuff like this. My third draft, if I have time and there is still money in the budget, also runs but is easier to maintain or interpret. Then, I got back to step one.

Funny thing, I wrote a book on matwork for judo and mixed martial arts which is selling amazingly well and I followed the same model. The first draft sucked, the second did not suck as much and after several iterations and rounds of editing, I’m quite proud of how it turned out.

CODE LIBRARIES

The other end of the spectrum from people trying to be the next Facebook / Google /Apple / Microsoft are people giving away their code for free. There are some awesome code libraries for javascript, like jquery and the jquery user interface, which allow you to do common needs like animation (hide something, show it, move it) and event handling (when the mouse is up, down,  a key clicked).

In between these two extreme are code libraries like impact.js , which I use for 2-D game development, that are not free but are well worth the price. Impact costs $99 and does so much of the game development for you – you can easily create levels, entities (players and their ‘enemies) and much more.

There are a couple of others on my list to download and check out  the second I have the time. I’ll let you know how that works out.

ASSETS/ WIDGETS etc

These are kind of like code libraries in that they are parts of your project pre-written for you. Whether it is downloading sprite sheets, Dreamweaver snippets, drop-down menus or reading papers in SAS Global Forum proceedings and copying macros, I have no shame about using other people’s code. The Internet is full of wonderful, generous smart people who make things and put them up for free just to share, show off, or get business.

They are also bits (both literally and figuratively) that you can buy for not a lot of money. I don’t have that silly idea that everything on the Internet can be free. If I can buy something for $30 and it would cost me more than $30 to create it myself, I do. Yes, maybe I could code it myself. I could also clean the office myself but I pay someone to do it.

It’s all about efficiency.

=================================================

Learn math. Save lives. Learn culture. Kill animals. (Relax, it’s a game.)

7 Generation Games Logo with feathers

← Previous Page