Wednesday, October 31, 2012

How to get predicted incidence rate using -poisson- of Stata

How to get predicted incidence rate using -poisson- of Stata

The Stata -poisson- can be used to model  count variables/incidence rate. However, the default predicted margin is a predicted number of events. We need use the -predict(ir)- option to get the predicted incidence rate. 

-n-, the default, calculates the predicted number of events. -ir- calculates the incidence rate exp(Xjbeta), which is the predicted number of events when exposure is 1. Specifying -ir- is equivalent to specifying -n- when neither -offset()- nor -exposure()- was specified when the model was fit. For example:

webuse nhanes2, clear
svy: poisson hlthstat age i.region
margins region, predict(ir) at(age=50) vce(svy)

Factor variable operators

  • i. unary operator to specifiy indicators
  • c. unary operator to treat as continuous
  • o. unary operator to omit a variable or indicator
  • # binary operator to specify interactions
  • ## binary operator to specify full-factorial interactions
  • use ib#., ib(first)., ib(last)., ib(freq). to set base level
  • ibn. means no baselevel
  • ".fvset base 3 group" sets the base for group to be 3
  • ".list if 3.group" to list all when group is equal to 3.
  • ".gen over_age=cond(3.group, age-21, 0)"


Tuesday, October 23, 2012


"YOUTH" - Samuel Ullman
Source: Samuel Ullman Museum

Youth is not a time of life; it is a state of mind; it is not a matter of rosy cheeks, red lips and supple knees; it is a matter of the will, a quality of the imagination, a vigor of the emotions; it is the freshness of the deep springs of life.

Youth means a temperamental predominance of courage over timidity of the appetite, for adventure over the love of ease. This often exists in a man of sixty more than a boy of twenty. Nobody grows old merely by a number of years. We grow old by deserting our ideals.

Years may wrinkle the skin, but to give up enthusiasm wrinkles the soul. Worry, fear, self-distrust bows the heart and turns the spirit back to dust.

Whether sixty or sixteen, there is in every human being's heart the lure of wonder, the unfailing child-like appetite of what's next, and the joy of the game of living. In the center of your heart and my heart there is a wireless station; so long as it receives messages of beauty, hope, cheer, courage and power from men and from the infinite, so long are you young.

When the aerials are down, and your spirit is covered with snows of cynicism and the ice of pessimism, then you are grown old, even at twenty, but as long as your aerials are up, to catch the waves of optimism, there is hope you may die young at eighty.


青  春 - 塞缪尔.乌尔曼
人生匆匆,青春不是易逝的一段。青春应是一种永恒的心态。满脸红光,嘴唇红润,腿脚灵活,这些都不是青春的全部。真正的青春啊,它是一种坚强的意志,是一种想象力的高品位,是感情充沛饱满,是生命之泉的清澈常新。

青春意味着勇敢战胜怯懦,青春意味着进取战胜安逸,年月的轮回就一定导致衰老吗?要知道呵,老态龙钟是因为放弃了对真理的追求。

无情岁月的流逝,留下了深深的皱纹,而热忱的丧失,会在深处打下烙印。焦虑、恐惧、自卑,终会使心情沮丧,意志消亡。

60也罢,16也罢,每个人的心田都应保持着不泯的意志,去探索新鲜的事物,去追求人生乐趣。我们的心中都应有座无线电台,只要不断地接受来自人类和上帝的美感、希望、勇气和力量,我们就会永葆青春。

倘若你收起天线,使自己的心灵蒙上玩世不恭的霜雪和悲观厌世的冰凌,即使你年方20,你已垂垂老矣;倘若你已经80高龄,临于辞世,若竖起天线去收听乐观进取的电波,你仍会青春焕发。 

Friday, October 19, 2012

Look AHEAD halted: Lifestyle management fails to reduce hard CV outcomes in diabetics

Look AHEAD halted: Lifestyle management fails to reduce hard CV outcomes in diabetics
Source: theHeart.org

Los Angeles, CA - The Action for Health Diabetes (Look AHEAD) study, a trial comparing an intensive lifestyle-intervention program aimed at achieving and maintaining weight loss and fitness in patients with type 2 diabetes, has been stopped for futility.

A large cardiovascular-outcomes study funded by the National Institutes of Health that included 5145 adults with diabetes and a body mass index >25 kg/m2, Look AHEAD failed to show a difference in the rate of nonfatal MI, nonfatal stroke, death, or hospitalization for angina among patients randomized to an intensive lifestyle intervention and those randomized to a control arm consisting of education alone.

Despite significant reductions in weight and improvements in physical-fitness levels among patients with diabetes, investigators concluded that the intervention arm, which included individual sessions with a nutritionist and/or personal trainer, as well as group sessions and refresher courses, failed to provide any benefit in terms of cardiovascular outcomes.

Dr Anne Peters (University of Southern California, Los Angeles), one of the study investigators, said in an interview that the trial was successful on one level-namely, that patients lost weight and improved their fitness. Data published at four years showed that the intensive intervention led to weight loss of up to 10% in the first year and that patients maintained a 6.5% reduction in body weight in the following three years. Over an 11-year follow-up period, the patients reported a 5% reduction in body weight from baseline, said Peters.

In addition, early data showed that treadmill fitness levels, hemoglobin A1c levels, systolic and diastolic blood pressure, HDL-cholesterol levels, and triglyceride levels were all significantly improved among patients in the lifestyle-intervention arm when compared with the control group. The only cardiovascular risk factor that remained unchanged with treatment was LDL-cholesterol levels.

Despite the lack of cardiovascular benefit observed in Look AHEAD, Peters stressed that diabetic patients should not stop exercising or begin eating anything they wish.
"We do know that weight loss and exercise can prevent diabetes," said Peters. "I am a big advocate of prevention, both early prevention of obesity altogether, as well as prevention of diabetes in individuals who have become overweight. Lifestyle changes can help prevent diabetes. Once you have diabetes, I think weight loss and exercise can have benefits, but they are not going to reduce the risk for the primary outcome that we set for Look AHEAD, which was a risk for macrovascular events or death."

Thursday, October 11, 2012

Tips of Using SAS

Tips of Using SAS

  • Richard Koopmann, Jr (2012). Building Macros and Tracking Their Use. This paper provides a framework for developing component macros that report back macro usage.
  • DM is a statement for submitting SAS program Editor, Log, Procedure Output or text editor commands as SAS statemetns. you can use -DM 'CAPS ON'- to set the upper case, use -DM 'COLOR COMMAND RED'- to set the command in red. Usually, I run the OPTIONS or DM at the beginning of my SAS codes.:
       DM 'CLE LOG; CLE OUT'; * CLEARS LOG AND OUTPUT WINDOW;
       DM 'KEYDEF F12 NEXT'; * ASSIGNS THE 'NEXT' COMMAND TO THE F12 KEY;
       OPTIONS NOFMTERR FORMDLIM='-' FORMCHAR='|----|+|---+' CENTER=0 MPRINT=1 MLOGIC=1;