Jan
28
I can do anything you can do better – and with SAS
January 28, 2010 | 2 Comments
Normally, things are very quiet in the De Mars household. Being out-numbered by daughters, two to one, my husband and I feel as if we need to maintain a united front against the younger generation. Last night, however, he irritated me. This was unfortunate because this is the man who, when we were dating, was referred to by the undergraduates I taught as Computer God. Why that is unfortunate is because I needed to do something and I didn’t want to go the effort of figuring out how to do it. Specifically, I wanted a job to ping two servers every day and email a message to the group the server status so if they went down, as happened in our last storms, someone would be notified when they came in that morning.
There were a half-dozen people who were discussing this and all of us knew generally that we could create a cronjob, set it to run at a specified time, have the output emailed using the Unix mail command and that job should be included in the crontab. However, as I tell my students all of the time, when you get a real job, people don’t want you to tell them generally how to do things. They want you to do @!$( . They don’t want a correct answer to a multiple choice question. They want code that works.
You might wonder why someone didn’t just figure this out. Well, it was the very end of the day and we all were feeling singularly unappreciated yesterday by managers who spend their time making color-coded boxes on stupid project management charts and telling us to remember to italicize headings in our documentation, so no one felt like staying the extra 15 minutes to figure it out.
[Hint: If you are a manager and you are thinking of popping by to tell me that I should not refer to your charts in my blog as “stupid”, well, I really wouldn’t do that if I were you. ]
I could have had the household Computer God do it in 5 minutes, but when it came up that evening I was already feeling like the old song between the husband and wife, “Anything you can do, I can do better”, so when he said,
“Do you want me to write a script to run that job for you?”
I said,
“No!” only omitting the drop dead because the little one was listening.
I guess I was particularly crabby yesterday, wasn’t I? Old people are like that.
My solution was this. We already have a SAS job that runs at 6 a.m. every day. I added this code to the bottom of it.
==========
Filename pinginf1 pipe “ping server1.school.edu” ;
Filename pinginf2 pipe “ping server2.school.edu” ;
Filename pingout “~/am_sas/pings.txt” ;
data test ;
infile pinginf1 pad ;
input dsn $50. ;
data test2 ;
infile pinginf2 pad ;
input dsn $50. ;
data test3 ;
set test test2 ;
data _null_ ;
set test3 ;
file pingout ;
put @1 dsn ;
X ‘mail -s “Servers status ” people@school.edu < ~/am_sas/pings.txt’ ;
=================
And it sent me the email:
server1.school.edu is alive
server2.school.edu is alive
So, done. It has the added benefit that if I DON’T get it I will know that the daily job which is supposed to run did not. I wanted this job to run on the same server and in the same file as this particular daily SAS job because it is in a group of servers that are monitored 24-7, while ours are not. It doesn’t really make sense to have a job running to test if the servers are down on a server that might go down.
There is an actual point in here regarding SAS, four actually.
- You can send the output of any Unix command to a SAS dataset by using the PIPE option on the FILENAME command.
- These datasets can be treated like any other SAS dataset.
- You can use the X command to execute Unix commands within a SAS job.
- One of the convenient uses of the X command is to execute a mail command to send yourself a file.
Yes, you can do this with a Unix script and a bunch of other ways. You can do it more elegantly in SAS. But here is how to ping your servers and have it email you the file in a few lines of code that took five minutes to write.
As for the Computer God, he just called me to say that he had done it on the Mac using automator and would show me how he did it when I got home if I want. One of my co-workers said that was nice. Still not appeased, I said it was my husband’s preference to write code as opposed to help clean up the house, and asked him,
“What would you rather do if you were married, help write a simple script or help clean?”
He said,
“Well, if I was married to you, I’d run !”
Young people are so wimpy these days. I’ m going to go home, have a glass of Chardonnay and see how to do this using automator and scheduling it through iCal. The secret to staying married is never to stay mad too long. I can’t afford to. I need him to help me over-power the children.
True fact #1: Photo above is of child #3 shortly after she had fallen down a mountain.
True fact #2: No story, no matter what precedes it, will be approved of by your mother if it ends with the line “And then I fell down a mountain.”
Jan
21
The data show – you’re screwed
January 21, 2010 | 1 Comment
My Republican friends, of which I have none, are really not going to like these results. The findings from my latest analysis are not entirely unexpected. Several years ago I attended a bilingual education conference where the keynote speaker was a middle-aged, white, male demographer from Texas. Yes, I was thinking exactly the same as you, the conference planners must have run out of money before they got to this line item. What could he possibly say about bilingual education from either a personal or professional perspective? He turned out to be fascinating, and although I don’t remember his name, I clearly remember him saying this:
“Even if I was the most bigoted middle-aged white male on the face of the earth, I would be advocating hard for the education of bilingual children because it would be in my self-interest.”
I actually do have exactly three rabid Republican friends, who are constantly sending me email about how the country is going to hell in a handbasket because of all of these government transfer payments. They are partly right about that.
Tax rates are extremely high. My husband and I are fortunate enough to have graduate degrees (courtesy of that government-funded institution, the University of California). In addition, I do quite a bit of consulting work. The result is we pay about 50% of our income in federal, state and corporate taxes. So much taxes that my Republican friends are right, it is a disincentive to work more, and, after several years, I just quit my third job teaching statistics and research methods in the graduate school of a couple of other universities. It just wasn’t worth it since I only got to keep half the money.
That, to me, is not a terrible outcome, though. It’s not as if the world’s most spoiled 11-year-old isn’t going to get that rock-climbing gym membership for her birthday because I am only working 55 hours a week instead of 65. The universities won’t quit offering statistics courses, these will just be taught by someone younger than me who needs the money more. That’s not a terrible outcome, either.
My Republican friends are also correct that a heck of a lot of people are getting paid by the government in this country. In fact, according to the Social Security Administration, there are 52.5 million beneficiaries. With a population of approximately 304 million in this country that represents about 17% of the population on the dole.
Below is the percentage of people in the country receiving payments from the Social Security Administration, by state. My ultra-liberal yuppie home state of California is relatively low, while those commie Republican states like North Dakota, Florida and Oklahoma are sucking up my tax dollars.
Let’s see what’s really happening here … In fact, the vast proportion of people receiving social security payments are not slackers feigning disability. The majority, 70%, are retired workers like my 77-year-old mother and 85-year-old father. I don’t think they are going to get out of their beach chairs by the pool at their house in Florida and get a job any time soon.
Another 14% of those receiving social security payments are survivors of deceased workers. My husband died when my daughters were ages 8, 9 and 12. They didn’t get out and get jobs either, the lazy slobs. Here is an interesting fact about social security survivors benefits – when the social security office told me how much I would receive each month I was very surprised by the amount and said,
“That’s per month?”
and the clerk responded,
“No, per child.”
I received MORE THAN SIX TIMES what a family on welfare (i.e., Temporary Assistance to Needy Families) would have received. And I had a full-time job as a professor on top of it. I know what my late husband (who, I must admit, was a Republican) would have said,
“I paid hundreds of thousands of dollars into that system. My kids damn well ought to get it.”
Speaking of my late husband, he was 54 years old when he died. If we look at why people are really getting more social security payments in those darker states we need look no further than the average age. The graph below shows the percentage of people over 65 in each state. It is almost a mirror image of the graph above. The older people are, the more likely they are to retire. The older the average age in the state, the more people will die, leaving behind them survivors to collect benefits. Also, the older a worker, the more likely he or she is to have a disability. It is a simple risk function. Even if your risk was stable (which it isn’t, but let’s ignore that for a moment) , assuming that people who are disabled stay disabled for some time, at each passing year, the number of disabled workers of that age accumulates.
The American population is aging. Even without that health care that you are so intent on denying people who are not on social security, the number of people receiving government benefits is going up and up. Who is going to pay it? Well, as that demographer from Texas said long ago, social security payments don’t actually come from the money my mom put in back in 1975. Nope, they come from the money being paid in by workers right now. The dependency ratio, the number of beneficiaries per worker, is going up and up.
So, where are we going to get those new, young workers? Funny thing, there. The median age of the Latino population in this country is 27.6, almost ten years younger than the median for the U.S. population as a whole. Here is another fascinating graph for you, a bit out of date but it hasn’t changed that much in the last 20 years.
See those light states that have very few Latinos? They are the exact same ones as the darker states above that have the most social security recipients. Young people don’t collect much in social security.
What about TANF ? In fact, in 2009 there were slightly over 4 million people receiving Temporary Assistance to Needy Families, less than 8% of the social security case load.
So, here’s the bottom line folks, if you want to cut the percentage of people receiving government payments your choices are:
- Die younger.
- Retire older.
- Cut benefits to people on social security, who are overwhelmingly elderly and survivors of deceased workers.
- Get more younger people in the work force paying into the social security system.
That is another interesting statistic. I have four children; three are now in the workforce paying taxes and one is in sixth grade. My three Republican friends, all married, have a total of four children among them.
You can send me all the hate mail you want, you can scream and yell and ditto Rush Limbaugh forever. The data are pretty clear, folks. Your continued social security is dependent on my children and others like them being willing to tax themselves so you can have free Medicare and live in the style to which you want to be accustomed. All I can say to that is, I hope you have a LOT of money socked away in your 401k.
Jan
17
Good Stuff in the Internet Candy Store
January 17, 2010 | Leave a Comment
Grown-ups lie to kids. I have discovered this.
When I was young, my mom did not have a lot of money, and so things like trips to Disneyland, when they occurred at all, were on an extremely tight budget. No buying candy, souvenirs or extras. I swore that when I grew up, went to graduate school and made money I was going to go to Disneyland and buy whatever I wanted. The grown-ups told me that it would not be what I expected, that by the time I was an adult it wouldn’t be the fun I thought it would be.
They were wrong. I have been to Disneyland a dozen times, stayed at the different hotels, ridden all the rides a hundred times and, to this day, whether it is Disneyland, Seaport Village or the Third Street Promenade, I go into almost every candy store I see and buy one of everything, and it is GREAT! (And yes, I weigh less than I did as a teenager, but I must admit that I am pretty certain that I have single-handedly paid to put my dentist’s kid through USC.)
Another thing grown-ups lied about. All of that random crap I had to learn in high school that I did not want to learn never came in useful and I doubt it ever will. The things I did not want to learn included Chinese poetry, the pluperfect tense (or something, I still don’t know what it is). The classes I took that I actually WANTED to take, like Matrix Algebra, Analytic Geometry – that turned out to be stuff I have used my whole career.
[By the way, this does not apply to college, where Washington University in St. Louis was right and I was wrong. Those programming courses that I did not want to take back in 1976 because I was never going to use a computer, uh, thanks to the dean of the Business School or whoever the person was who clearly had a lot more foresight than me as a college sophomore.]
All the way through four degrees I said that when I graduated I was going to learn what I was interested in learning, and it would be GREAT. The grown-ups said the workplace is not like that.
Well, guess what? I work at a university with 26 libraries, a few miles from the five-story downtown Los Angeles Public Library, a few blocks from the brand new Santa Monica Public Library, and they have this new thing that exploded since I left graduate school called the Internet. You can find more stuff in it than a candy store, I spend much of my time just learning what I am interested in and it is GREAT . Even better, since my job is to consult on statistical software, I get paid.
There are a few sites that I like so much that when I found them, I felt like someone had given me a present.
Tom Peters website actually does give you presents, in the form of downloadable files of slides from his presentations. Tom became famous for his book In search of excellence, but he has done a great deal since then. He was even a speaker at SAS Global Forum. His site also has the best leads (for me) on other sites I would find worth spending a lot of my time reading, we must have nearly identical interests, but he is much, much richer. I would feel envious about that except that he lives in Vermont where it is freezing while I live in Santa Monica where the weather is so beautiful that when you come outside in the morning it is like being kissed by God.
Speaking of not being envious, the Clarion Call to Leadership blog has some of the best advice not just on being a good leader but being a good person.
Cool & Tech-y
100 Great Blogs for Librarians – librarians?! Yes, actually, much of what goes on in libraries now is computer labs, database searches, electronic books, e-journals. The library where our consulting office is located is four stories, only one of which holds books. Two of the floors are computer labs. Don’t actually know what is on the third floor. Maybe that is where they house the trolls. I’ve always suspected there were trolls on campus somewhere. There are 100 blogs here, hence the name (duh!) . Like libraries themselves, this is a good place for browsing.
Statistics
Social Science Statistics blogs – random, interesting things
LoveStats – how could you not like a blog with a name like that?
Just cool
Then there is all the just cool amazing stuff like
National Public Radio – my daughter, the perfect Jennifer, who is in graduate school, Julia, the world’s most spoiled 11-year-old, my husband (the rocket scientist/ cartoon fanatic) and me all love their podcasts.
Free e-books – books for free? I thought I had died and gone to heaven. Much of what I found here is junk food for the brain, mystery novels written in the 19th century and the like, but they were well-written, and, as you might guess by my candy fetish, I am not always about the meat and potatoes of life.
What have we learned? That life as a grown-up CAN be every bit as good as you imagined it when you were a kid. Can you believe it, your own PERSONAL computer !! (I’m still waiting for my flying car.)
Jan
5
Who Wants Dweezil Masfbid ?
January 5, 2010 | Leave a Comment
In trying to decide what courses to teach, it is not as simple as looking at what products are used the most because, to some extent, we are looking at the result of a self-fulfilling prophecy. No one calls up and tries to order a product or schedule a class for something that they don’t know exists.
For years, our university licensed SAS Enterprise Guide. We did not distribute it with SAS, we offered no classes on how to use it, it was not installed in our labs and no one requested it. Last year, we started offering classes, installed Enterprise Guide in our labs and started including it as a default in our distribution. The Enterprise Guide class had the largest enrollment of anything we offered last year (more even than Introduction to SPSS, which is usually the biggest and has been offered every semester forever).
Let’s say there is a solution out there called Dweezil Masfbid. You keep the biological component of it on your desk, a small shrimp-like object created through genetic engineering, which reads your brain waves and determines what it is that you really want to accomplish. The electronic component, also on your desk, attached like an external hard drive, does the programming to meet your goals, prints out a graphical portrayal on your desktop printer which it also emails to three managers with whom you interact most frequently. It then creates a clone to attend the subsequently scheduled meeting for you and present the completed project. Yet, you have never requested a Dweezil Masfbid of your very own, have you? Nor have you attended any DM training. Why not? Well, the answer is pretty obvious. You didn’t know it was an option, now, did you?
I need to decide what courses I am going to teach this semester so I can get the descriptions up on the calendar. I do have titles, SAS for Researchers, Really Basic SPSS, Introduction to SAS and SPSS Statistics. I will probably also do a couple more. I also need to come up with a couple of summer school titles as well.
My question for myself is, what would it help people to learn? Definitely going to include the Complex Samples add-on from SPSS somewhere based on the fact that two people last semester had problems that would solve. Survival analysis is a popular topic around here, so I might add more on Cox regression and Kaplan-Meier . SPSS has some other cool stuff like AMOS and Decision Trees but unless we can get it on an educational discount we won’t have many graduate students or junior faculty dropping two grand for a couple of pieces of software.
“Step right up and get your dweezil masfbid here, folks! Only $3,141,592,653 ! ”
[Anyone who recognized that number as the first ten digits of pi wins six thousand nerd points which can be traded in for a coaxial cable. ]
I keep promising to learn JMP but have only dabbled with it. I think if I could get it to somehow connect to SAS that I would get a lot more excited about it. I know that is supposed to be an option but no one here has managed to do it and we have a lot of people with Ph.D. ‘s and a lot of technical know-how. After everything we went through getting SAS 9.2 installed everywhere last year the absolute lowest priority on my list is anything that requires substantial effort just to get the major features working. Our SAS support staff, SAS administrator, SAS documentation author and 11 other things is me. My research assistant is young and eager, not old, jaded and crotchety like me. She gets back from vacation next week. I think I will assign her to come up with whatever she can on using JMP and then give it a second look.
Stata has its good points and some departments require its use but there is very little that can be done with Stata that one could not to easier with SAS or SPSS. There may be some unique Stata capabilities but each of these will only apply to about 8 of the 50,000 people at the university. This makes Stata really cool and wonderful if you are one of those eight, of course, which is why we offer it and why I do one-on-one instruction for people who need to get to at least an intermediate level with Stata really fast. Think young, happy research assistant can take a look at Stata for more ideas, too. She should be rested after having two more weeks of vacation than me.
As for me, I think I will look into Proc SQL, EIS, SAS Forecasting and see what cool uses of SPSS might exist without using R (because 99.9% of the people won’t) or requiring add-ons that add up to the cost of your first-born.
In all of that together, maybe we’ll find the dweezil masfbid.
Blogroll
- Andrew Gelman's statistics blog - is far more interesting than the name
- Biological research made interesting
- Interesting economics blog
- Love Stats Blog - How can you not love a market research blog with a name like that?
- Me, twitter - Thoughts on stats
- SAS Blog for the rest of us - Not as funny as some, but twice as smart. If this is for the rest of us, who are those other people?
- Simply Statistics, simply interesting
- Tech News that Doesn’t Suck
- The Endeavor -John D Cook - Another statistics blog