In which Phiala talks very little about string. You can pretty much all skip this (except for the last paragraph).

I spent the entire day wresting with structural equation modeling (SEM). Now, don’t get me wrong – I actually like statistics, and computer programming stuff, and have an R package on CRAN and everything. I understand the concepts behind structural equation modeling, and have intended for a long time to sit down and learn to do it. I now have the perfect project – a complex, multicausal, correlated mass o’data just begging for a fancy path diagram.

But apparently SEM software and I don’t get along. At all.

Being an R geek (see above), I naturally started with the sem package. I can get the examples to run, no problem. I even got some of Jim Grace’s examples from his SEM book, Structural Equation Modeling and Natural Systems. [I should ask him whether he would be interested in having my R notes on doing his examples; he doesn’t use R, though he mentions it on his website.)

However… once I tried my own data… ka-boom. All sorts of weird errors. I tried standardizing, not standardizing, changing the model specification… no luck. I went back to the documentation, and read it more carefully. I read more in Grace’s book, in case I was missing something conceptual. No luck.

I started paring down my model by dropping one of the exogenous latent variables (there are two in my test case). Hey, that runs! No wait, it gives NaN for all the parameters of interest. Try again, minor changes… that time it works! Whoo-hoo! Make another change that might improve things. No good. Back up a step to the previous success.

Error messages.

Double-check.

Error messages.

Try something else. And so on. Apparently there’s an instability somewhere in my model, and sometimes it works and sometimes it doesn’t. Not good. None of my test models will work consistently. Finally all of them quit working with negative variance / NaN errors, and I decided that after ten hours at work it was time to go home.

Half a Guiness and some time with the spinning wheel and a pile of camel-silk-merino, I was relaxed, refreshed, and ready to try again. (See? An eensy bit of string here.)

The sem package in R is not very sophisticated, as the author admits. Maybe having a fancier program with better diagnostics would help me figure out what is going wrong. One of the big commercial SEM packages, LISREL, has a 15-day demo version. I can give it a try, and if that works, one of the Penn State computer labs has a 5-seat license. For the project in question, I can go to the lab for a couple days and get it beaten out. Once I figure out how to do so.

So, LISREL, trial version. Download and install. Home on the couch, dog on my feet – much more relaxing and cozier than spending a zillion hours at work, no? Start working through the SEM example in the help. Hm… those written directions do not match that path diagram. Try it anyway; no go. Add some arrows to make my model match the one in the help file. Hit run. LISREL goes bye-bye.

See? Me & SEM software, not simpatico.

I have one lousy project to do, a paper that was intended to be done in early August. All sorts of things have gone wrong with this manuscript, but the preliminary conclusions are very exciting. But the whole thing is very complicated, and statistically not so nice, and so structural equation modeling would be just the thing.

If only.

I try not to talk about work here, because really, who cares besides me? String is so much more fun, and more socially acceptable too. But every so often, a work-obsessed scientist just can’t help herself!

Back to string, briefly, for anyone who made it this far.

Over lunch today I was browsing the Internet, and found not one but two local (State College, PA) knit bloggers! How cool is that!?!
Knitting Librarian and robknits, both of whom are far better knitters than I am. The latter blogger also weaves. I’m sure there are more State College string bloggers out there; I shall have to keep my eyes open.

2 responses to “The structure of things”

  1. Arachnera Avatar

    I’m afraid I don’t even know quite what SEM software is, but I’m sorry that you couldn’t get it to work. Good luck with getting that paper finished!

  2. Laura Avatar
    Laura

    Hmm. In my world, SEM is “scanning electron microscope.” A different beastie entirely! Massive tariff classification frenzy this week: all the tiny parts to build a tool. And most of the descriptions are in Dutch. Is it Friday yet?

Welcome!

I’ve been doing stuff with string for quite some time, and describing it to others online since 1996 or so at Phiala’s String Page.

I also do some science and write some fiction.

I’m Phiala most places on the internet.