Wellyopolis

March 26, 2009

Department of funny error messages

From Microsoft Word, opening a document with lots of students' names in it.

Posted by eroberts at 10:47 PM

July 8, 2008

Knowing your stable mates

Surely Microsoft Entourage (=Outlook for the Mac) should not flag "Powerpoint" as a spelling mistake ...

Posted by eroberts at 12:29 AM

January 2, 2007

Width specified for format X is invalid

File this under entries I write for other people googling for the same problem I had ... and of no interest to most readers.

In SAS when writing out a file when you are PUTting the character variables you do it like this:
<variable-name> <begin-column> - <end-column>

If you happen to spell a variable's name incorrectly, say you put "ANMN" instead of "ANM" (for semi-obvious reasons I often type "N" after "M") the error message returned will be something like this
"Width specified for format F is invalid"
rather than something like
"ERROR: <variable-name> does not exist."
which would be more informative.

Spelling errors corrected the file wrote out correctly, but not after spending 10 minutes wondering which basically unformatted variable was formatted incorrectly.

Posted by eroberts at 3:48 PM

September 7, 2006

Learning something new everyday

newform. When you want to pad lines in a big file. Not something you'll want to do every day, but when you have to, now you know.

Posted by eroberts at 12:34 PM

July 13, 2006

Writing hierarchical datasets in SAS

Really, I don't expect anyone among my regular readers [of my irregular writing] to be interested in this. But do say in comments if you are ...

I had cause today to have to write a hierarchical dataset. Now, reading a hierarchical dataset into a statistical program is so routine that the internet is rife with examples (SAS, Stata). Perhaps my Google skills are rusty, but not so much help from the internets with writing a hierarchical dataset. (Does anyone else have trouble typing hierarchical? I feel like I'm spelling it wrong at least half the time).

Anyway, I digress. The example code below assumes that you have a variable that uniquely identifies the unit that contains other observations. Or, more specifically you might have a household serial number or a family identification number.

SORT your data. The first step is to sort the data by the household or family serial number. If you have some identifier within the family or household (a person number, unique within the household or family, for example) it helps to sort by that too.

Then it's straightforward

DATA _NULL_ ; /* No need to write a SAS dataset at the same time */
SET <file you are reading from> ;
BY <household or family identification number> ;

FILE "<full path and name of the file you want to write>" ;

IF first.<household or family identification number> THEN DO ;
PUT <first household variable> <format> <begin-column> - <end-column>
<second household variable> <format> <begin-column> - <end-column>
....
<last household variable> <format> <begin-column> - <end-column> ;
OUTPUT ;
END ;

PUT <first person variable> <format> <begin-column> - <end-column>
<second person variable> <format> <begin-column> - <end-column>
....
<last person variable> <format> <begin-column> - <end-column> ;
OUTPUT ;
RUN ;

Some notes and caveats.


  • If your data are formatted. For example, if you have associated "Minnesota" with the number "27", then by default SAS will put "Minnesota" instead of "27". This is easy to solve with a "FORMAT _all_ ;" statement after the BY statement. This will clear all formats.
  • You can obviously include IF and WHERE statements after the SET statement to write out a subset of the data.
  • By default, character values will be left aligned. The magic internet will help you find out how to align character values where you want them.
  • Numbers will not be zero padded after the FORMAT _ALL_ statement, so you may wish to format all numbers with the appropriate Zw.d format you require.

Good luck. Comments are not expected, but welcome.

Posted by eroberts at 5:59 PM

May 23, 2006

Foxmarks

Running Firefox on multiple computers? Want to keep your bookmarks synchronized?

Try Foxmarks. The price is right: free.

Posted by eroberts at 6:31 AM

March 14, 2006

Same name, different places

Let me just note for posterity that this message drives me batty.

I think I remember that in Windows 3.1 and Windows 95 that you could do this. Why it's not possible in later, otherwise more advanced versions, of Windows, I don't know. And it's possible in the Macintosh version of Microsoft Office. I cannot be—I know I am not—the only person in the world who regularly works—nay, tries to work— on documents with the same structure, function and thus name in related projects who would like this to be possible.

Posted by robe0419 at 3:04 PM

March 10, 2006

Words fail me ...

Posted by robe0419 at 12:42 PM

January 27, 2006

Picasa

A few months ago I mentioned how I was using the digital camera to make copies of a lot of material for my dissertation. On the laptop, iPhoto is all that you would expect from Apple. Easy to use, doesn't hog memory, perhaps lacks some advanced features, can't quibble with the price. But I also manage some of my gigabytes of digital data on the PC at work, and frankly the default picture viewers in Windows weren't great. Enter Picasa. From Google. Highly recommended, and I am not on commission.

Posted by robe0419 at 5:37 PM

January 11, 2006

Tweak UI

Frustrated by the standard Windows dialog boxes not providing quick access in the "Places Bar" to your own frequently used drives and folders? Wish you could add whatever folders you wanted to the "Places Bar" like you can in Mac OS X? You can, with Tweak UI, a little extension for Windows, endorsed but not officially supported by Microsoft. Nifty and free.

Posted by robe0419 at 2:08 PM

August 30, 2005

What about the radio?

The iPod/cellphone is said to be on it's way. As my current cellphone and iPod don't "need" replacing I will console myself with the thought that when I do replace them the iPodPhone will be cheaper and most all the bugs will be ironed out. Never buy the first release of electronic equipment, I say. Even from Apple.

But what about a humble radio receiver? Is there no market for this device? Is it not technically possible? One of the things I enjoyed about the humble 1980s-technology Walkman was that it included a radio. Having paid my Minnesota Public Radio subscription it would be nice to not need an extra device for listening to the humble FM radio signal.

My next wish will be that all correspondence revert to the printed form, and that competitive athletic events take place at 3pm with mandatory dressing in dark-colored cotton clothing. In other words, I acknowledge that the portable radio market may be out with the Ark.

Posted by robe0419 at 2:14 PM

July 6, 2005

PSA: Default browser in OS X/Panther

Public service announcement: To change the default browser in OS X/Panther you have to open Safari, open its preferences, and change the default browser there.

Back to your regularly scheduled activities ...

Posted by robe0419 at 11:36 AM

May 7, 2005

CD labeling programs for Mac

Do any readers have recommendations for good CD labeling programs for a Mac? Please leave any thoughts in comments. Thanks in advance!

Posted by robe0419 at 2:48 PM

March 8, 2005

Hidden costs of the iPod

The iPod is a beautiful thing, but what Apple doesn't tell you is how long you'll spend inserting CDs into your computer, ripping them, and then updating the iPod.

It seems that you can pay people to do this, for at least $1 per CD. Oh to be a Fortune magazine reader, and not wince at spending an extra $200 or more after the iPod itself ...

My approach has been to rip CDs while doing "busy work" at the computer. Entering references into EndNote, reading email, and other easily interrupted tasks are ideal for doing at the same time as ripping CDs. That said, I still have over 100 CDs to go, and it will take me a while to finish this project ...

Posted by robe0419 at 8:07 PM

February 3, 2005

things I can never remember

When you're reading in text files to SPSS, SAS or Stata it's a teeny weeny bit annoying that they all place the indicator that a variable is string rather than numeric in different places.
SPSS: <variable name> <begin-column> - <end column> (a)
SAS: <variable name> $ <begin-column> - <end column>
Stata: str(n) <variable name> <begin-column> - <end column>

If this means nothing to you, be glad ...

Posted by robe0419 at 9:59 AM

June 10, 2004

seeing double

having become the lucky user of a new PC with dual monitor support recently, I have traded physical desk space for screen space, and now have two monitors on the desktop. excellent for the multi-tasking!

Posted by robe0419 at 3:12 PM