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;

Tuesday, September 18, 2012

In ‘Obesity Paradox,’ Thinner May Mean Sicker



"… Dr. Neil Ruderman, an endocrinologist at Boston University School of Medicine, was the first to identify a condition he called "metabolically obese normal weight," in 1981. Such people have weights in the normal range on the B.M.I. chart but also have metabolic abnormalities, including high levels of insulin resistance and triglycerides; they tend to carry fat around the middle, which is more apt to affect the heart, liver and other organs than fat in the hips and thighs…."
This evidence is not new. I post here to reminder myself about this called 'paradox' (not a paradox to me).

Tuesday, September 11, 2012

Geriatric Obesity - a Special Issue of International Journal of Obesity


International Journal of Obesity just released a special issue on geriatiric obesity. It concluded that more research is needed to clarify the definition, to evaluate the tiem of treatment, and  strategies treatment of obesity in older adults.
Scoping review report: obesity in older adults

Obesity in the elderly: an emerging health issue

Monday, September 10, 2012

Tips of Using PortableApps

Tips of Using PortableApps

PortableApps.com is the world's most popular portable software solution allowing you to take your favorite software with you. The launcher is not as good as I expect; I am using PStart  and manually change some 'ini' files to meet my needs:
  • How to disable the splash screen of AppNamePortable:
    • go to "\PortableApps\AppNamePortable\Other\Source".
    • open "AppNamePortable.ini".
    • change  " DisableSplashScreen=False" into  " DisableSplashScreen=True ", and save change.
    • copy  "AppNamePortable.ini" into "PortableApps\AppNamePortable".
  • How to remove PortableApps icon from task bar (to minimize to tray).
    • go to "\PortableApps\PortableApps.com\Data\".
    • open "PortableAppsMenu.ini".
    • under [DisplayOptions], add "Windows7TaskbarIcon=false".
  • How to set global hot key (11.1 and up)
    • by default, the platform uses a global hot key of Ctrl-Alt-Space to show the menu from other apps. 
    • open "\PortableApps\PortableApps.com\Data\PortableAppsMenu.ini"
    • changing the line GlobalHotKey=CTRL-ALT-SPACE to another value. Valid entries are CTRL-ALT-SPACE, CTRL-ALT-P, CTRL-ALT-M, CTRL-SPACE, WIN-ALT-SPACE and DISABLED.
  • How to set autorun modification detection
    • open "\PortableApps\PortableApps.com\Data\PortableAppsMenu.ini"
    • changing the line AutoRun=true to AutoRun=false in the [Protection] section. Note that some antivirus products may show an alert when an autorun.inf is read.
    • Q & A of PortableApps.com Platform and Suite Support
    • ...

    Friday, September 07, 2012

    How to Combine the Results after the Multiply Imputation

    How to Combine the Results after the Multiple Imputation
    The overall estimate of Q is simply the average of the M estimates from M multiple imputed datasets.
    The overall variance of is
    Where the average variance of M within-imputed datasets () is and the variance between-imputed dataset is

    The overall degree of freedom (df) is
    Where the df of imputed datasets is and the df of observed data is


    If the df of the complete data (dfcompleted) are large [Notes: for complex sampling design, dfcomplete = # of PSU - # of Strata], the overall degree of freedom is
    Then, the confidence intervals can be
    The estimated percent rate of missing information for Q is
    Notes: Usually M = 5 or 10 is enough, but the M is better to be great than the percent rate of missing information. 

    Wednesday, August 29, 2012

    How to Overlining Words in Microsoft Word

    Tips: Windows

    Tuesday, August 28, 2012

    Fifty Shades of Brown

    Fifty Shades of Brown: The Evolving View of Fat
    Source: Circulation

    This is an editorial article of a PVAT (Perivascular adipose tissue) study supports fat is friend not foe. I have learned decades ago in my medical school that the BAT (brown adipose tissue) which is major thermogenetic fat for an infant, especially cold area of world without heat. Now, researchers find that adults also have the BAT a little bit here and a little bit there.

    "...
    The relationship between increased body mass index and risk for diabetes mellitus or cardiovascular disease is well established. Such observations have driven considerable interest into the nature of adipose tissue and what mechanisms might help explain how adipose tissue and specific aspects of adipocyte biology influence cardiometabolic disorders. For example, adipocytes are now recognized as a source of mediators released into the circulation, like the adipokines resistin and adiponectin, which can modulate inflammation, insulin sensitivity, and atherosclerosis. Other molecules released from adipocytes like free fatty acids and reactive oxygen species can also exert both local and distant effects that may be integral to the development of diabetes mellitus, atherosclerosis, and their complications. To an increasing extent, adipose tissue is now understood as an organ playing important physiological and pathological roles. Both the absence of fat, as with certain lipodystrophies, and excess adiposity are associated with diabetes mellitus, with mechanisms that appear to include infiltration of inflammatory cells into adipose tissue and the release of systemic mediators.
    ..."

    Wednesday, August 08, 2012

    How to calculate confidence interval of incidence rate under the Poisson distribution


    How to calculate the confidence  interval of incidence rate under the Poisson distribution


    Incidence rate (IR) = # event (N) / person-time at risk (T)

    The exact Poisson confidence interval (CI) (Ulm, 1990): 
                       (1- α) % CI of N =
                       (1- α) % CI of IR


    If is large, 95% CI of N
                        95% CI of IR =  = 

    You may use PQRS or use an online calculate like GraphPad QuickCalcs, or Quantile Function Calculator to get a quantile of the chi-square distribution.


    The Online OpenEpi, a nice Epidemiologic Calculator, provides different ways to get these confidence intervals. I noticed, if N = 0, the calculator gives N = 0.5 to avoid unrealistic results.


    Stata can give exact Poisson CI:
         .cii T N, poisson

    Wednesday, August 01, 2012

    Recipes

    Recipes

    Thursday, July 12, 2012

    Special issue on lipotoxicity

    Editors: A. Vidal-Puig & R.Unger

    “It was sometime in March 2009 when our colleague Fritz Spener first proposed a special issue of BBA Molecular and Cell Biology of Lipids focused on the concept of lipotoxicity and its relevance as an integrative pathogenic mechanism of the metabolic syndrome. Although we might have hesitated a little initially, this did not last long as we realised that: a) ours would be a unique, high quality publication addressing the topic in depth and globally; b) this is an important area of research with enormous implications for metabolic disease and, in our opinion, its relevance is underestimated and relatively unknown among both the biomedical community and general public; and c) the great opportunities offered by new technologies and experimental models to understand the role of lipotoxicity in common metabolic diseases makes this a very timely issue. And also, of course, we expected strong support from the “lipotoxic community”. Certainly we have not been disappointed. In fact our colleagues have provided enormous support and their generosity has made this issue viable. Our only regret is that we have not been able to involve as many of the key experts as we wanted due to space constrains and the time scale of the project, and we hope this will not be the cause of any lost friendships!”


    Here is the special issue: Special issue on lipotoxicity.

    This issue isn’t new. I have got the similar hypothesis after I attended a lecture by J. Denis McGarry in 2001 (In memory of Dr. John Denis McGarry. His article "What if Minkowski Had Been Ageusic?"  is on the wall of my office all the time). I put this special issue on my blog to remind me keeping work on this hypothesis.

    Tuesday, July 10, 2012

    In Dieting, Magic Isn’t a Substitute for Science



    By GINA KOLATA
     "Is a calorie really just a calorie? Do calories from a soda have the same effect on your waistline as an equivalent number from an apple or a piece of chicken?"

    Thursday, July 05, 2012

    Studies of Human Microbiome Yield New Insights

    Studies of Human Microbiome Yield New Insights
    Source: NYTimes.com by Carl Zimmer
    "For a century, doctors have waged war against bacteria, using antibiotics as their weapons. But that relationship is changing as scientists become more familiar with the 100 trillion microbes that call us home - collectively known as the microbiome.
    ...". Read full article here.
    There is also a story about Zhao Liping combines traditional Chinese medicine and studies of gut microbes to understand and fight obesity on the Nature: My Microbiome and Me.

    Wednesday, July 04, 2012

    Revolutions: The role of Statistics in the Higgs Boson discovery

    The role of Statistics in the Higgs Boson discovery
    Source: Revolution Analytics
    News is starting to leak that the Large Hadron Collider may have accomplished its primary mission of confirming the existence of the hypothesised and heretofore elusive subatomic particle, the Higgs Boson. And sure, billions of Euros worth of state-of-the-art high-energy machinery and an army of experimental and theoretical physicists probably had something to do with the discovery. But did you know Statistics played a part as well? Check out this explainer video from PhD comics, below (an R chart even appears at the 00:27 mark):
    Full text: here

    What's in the world is a Higgs Boson? Source: NYTimes.com


    The Higgs Boson Explained from PHD Comics on Vimeo.