Tuesday, April 24, 2012

Matrix of Stata

Matrix of Stata
  • Define a -matrix- or -mat- in short: matrix matrixname = matrix_expression.
    • matrix define mymat = (1,2\3,4)
    • Or, matrix mymat = (1,2\3,4)
    • mat list mymat
  • Print a matrix: 
    • matrix list matrix_name
  • -matlist-: Display a matrix and control its format: 
    • matlist r(table)'*100, tw(20) format(%8.2f)
  • Matrix rename: .matrix rename oldname newname
  • Rename col/row names: 
    • matrix colnames A = names
    • matrix rownames A = names
  • Convert variables to matrix and vice versa: 
    • Matrix addition & subtraction:
      • mat matrix_a + matrix_b
      • mat matrix_a - matrix_b
    • Matrix multiplication:
      • mat matrix_a * matrix_b
    • Transpose of a matrix
      • mat matrix_t = matrix_a'
    • Inverse of a matrix, matrix function are defined by using parentheses ():
      • mat matrix_inv = inv(matrix_a)
    • A\B adds row of B after the rows of A; A,B adds columns B to matrix A. For example:
      • mat RTab=r(table)'
      • mat R1=RTab[1...,"b"]
      • mat R2=RTab[1...,"ll".."ul"]
      • mat RDisp=R1,R2
    • The usual way to obtain matrices after a command that produces matrices is simply to refer to the returned matrix in the standard way. (source: Stata manual) Or 'get()' matrix function obtains a copy of an internal Stata system matrix.
      • For instance all estimation commands return
        • e(b) coefficient vector
        • e(V) variance-covariance matrix of the estimates (VCE)
      • And these matrices can be referenced directly. For examples:
        • matrix list e(b)
        • mattrix myE = e(b)*100
        • matrix myV = e(V)*100
        • matrix myVget=get(_b)
      • Then, you can use
        • "ereturn post myE myV" to Change coefficient vector and variance-covariance matrix.
        • And "ereturn display" to create and display a coefficient table: "r(table)" that have been previously posted using "ereturn post" or "repost". "r(table)" is a matrix containing all the data displayed in the coefficient table (including b, se, t, pvalue, ll, ul, df, crit, and eform).
    • Reset row/column names of matrix
      • mat A = (1,2,3\ 4,5,6\ 7,8,9)
      • matrix rownames A = myrow1 myrow2 myrow3
      • mat colnames A = mycol1 mycol2 mycol3
      • refix the column names of A with equation names eq1, eq2, and eq3: mat coleq A = eq1 eq2 eq3
    • Matrix utilities:
      • matrix dir - List the currently defined matrices
      • matrix list - Display the contents of a matrix
      • matrix rename - Rename a matrix
      • matrix drop - Drop a matrix
    • Matrix Subscripting:
      • Referring to a matrix's element/cell using numbers of row and column or using the names of row and column or using mixed ways:
        • disp matrix_name [r,c]
        • matrix A = A/A[1,1]
        • gen newvar = oldvar/A[2,2]
        • mat B = V["price","price"]
        • gen sdif = dif/sqrt(V["price","price"])
      • Create a matrix B having the first through fifth rows and first through fifth columns of A, using two periods:
        • matrix B = A[1..5,1..5]
      • Create a matrix B having the all rows and first column of A, use three periods: 
        • matrix B = A[1...,1]
        • mat B=A[1...,"b"]
      • Define an element of a maxtrix:
        • mat A[1,2] = sqrt(2)
    • Abstract row and column names from a matrix (-rownames- and -colnames-: Macro extended function related to matrices). Also, we can use -rowfullnames matname-, and -colfullnames matname-
      • sysuse auto,clear
      • regress mpg price weight length
      • local rn :rownames r(table)
      • local cn :colnames r(table)
      • disp "`w1'" // price
      • disp "`:word 1 of `:colnames r(table)''" // price
      • disp "rownames = `rn'" _n "columnnames = `cn'"
      • disp `:word count `cn'' // 4
      • disp "`:word count `:colnames r(table)''" // 4
      • disp "`:colsof r(table)'" // 4
      • disp "`:rowsof r(table)'" // 9
      • forval i = 1/`:word count `cn'' {
      •   local varn: word `i' of `cn'
      •   disp "`varn'"
      •   }
    • Find out number of row and column (-colsof(matname)- and -rowsof(matname)-): Matrix functions
      • disp "number of row = " rowsof(r(table)) 
      • disp "number of column = " colsof(r(table)) 
    • How to do element-by-element operation
      • mata, the new matrix language of Stata (since version 9), can do element-by-element operation easily. (read more here)
      • Colon operations perform element-by-element operations: addition(:+), subtraction(:-), multiplication(:*), division(:/), power(:^), equality(:==), inequality(:!=), greater than(:>), greater than or equal to(:>=), less than(:<), less than or equal to(:<=), and(:&), or(:|)
      • If you apply the exponential function on each element:
        • . mata
        • : x=(0,1\2,3)
        • : exp(x) // x = (1,2.7\7.4,20.1)
        • : exp((0,1\2,3)) // (1,2.7\7.4,20.1)
        • : x:/2 // x = (0,0.5\1, 1.5)
        • : end
      • mata can use a Stata matrix
        • matrix A=r(table)'
        • mata: exp(st_matrix("A")) // display only
        • mata: st_matrix("se",sqrt(diagonal(st_matrix("V")))) // create a matrix of standard deviation
        • mata: st_matrix("expA", exp(st_matrix("A"))) // create a new matrix, expA
        • matrix eformtab=expA[1..., "b"], expA[1...,"ll".."ul"], expA[1...,"se"]
        • matlist eformtab*100, tw(30) format(%8.1f)
    • More about mata
      • create row vector: row=(1,2,3) or row=(1..3)
      • create column vector: col=(1\2\3) or col=(1::3)
      • transpose a matrix: m2=(0,1\2,3)'
      • scalar functions will operate on elements: sqrtrow=sqrt(row)
      • SSCC: an introduction to Mata

    Friday, April 20, 2012

    quantile regression

    Percentile and Quantile Regression for Complex Survey Data

    R!
                > library(survey)
                > options(survey.lonely.psu="remove")
                > dclus1<-svydesign(id=~psu_p, strata=~strat_p, weights=~wtfa, nest=TRUE, data=nhis)
                > bclus1<-as.svrepdesign(dclus1,type="bootstrap", replicates=100)
                > withReplicates(bclus1, quote(coef(rq(api00~api99, tau=0.5, weights=.weights))))
    • Survey analysis in R by Thomas Lumley.
    • How to deal with singleton/lonely PSUs (How do I analyze survey data with a stratified design with certainty PSUs?):
      • Default: - options(survey.lonely.psu="fail") -, which makes it an error to have a stratum with a single, non-certainty PSU. 
      • - options(survey.lonely.psu="remove") -,and - options(survey.lonely.psu="certainty") -, which can be set after the - library(survey)- mean a single-PSU stratum makes no contribution to the variance.
      • - options(survey.lonely.psu = "adjust") -, which is taking the average of all the strata with more than one PSU. This might be appropriate if the lonely PSUs were due to data missing at random rather than to design deficiencies.
      • Difficulties in estimating variances also arise when only one PSU in a stratum has observations in a particular domain or subpopulation. R gives a warning rather than an error when this occurs, and can optionally apply the "adjust" and "average" corrections. To apply the corrections, set - options(survey.adjust.domain.lonely=TRUE) -, and set - options(survey.lonely.psu="xxx") - to the adjustment method you want to use.
    Stata
    • Quantile regression
    • Stata: How do I obtain percentiles for survey data?
    • If only need point estimates of quantiles: we can use "_pctile" (store them in r()), "pctile" (create variables containing percentiles), and "xtile" (create variable containing quantile categories) to get quantiles for survey data. Or use "qreg"
      • webuse nhanes2
      • _pctile height [pw=finalwgt], p(10,90)
        • return list
        • disp "Median of age = " scalar(r(r1))
      • pctile qhgt=height [pw=finalwgt], nq(4) genp(percent)
      • xtile hgtdec=height[pw=finalwgt], nq(10)
      • table sex [pweight= finalwgt] , c(median age count age) row format(%9.0f)
      • qreg height [pw=finalwgt], quantile(10)
      • mi estimate: qreg height, quanitle(10) vsquish
    • If need standard errors and CIs, use user-written command "epctile" ("findit epctile")(or directly from "net from http://members.socket.net/~skolenik/stata/").
      • webuse nhanes2
      • svyset psu [pw=finalwgt], strata(strata)
      • epctile height, p(10) svy
      • epctile height, percentiles(10 20 30 50) subpop(if sex==1) svy
      • Or, see my update (3/3/2017) below
    • Replicate Weights and Bootstrap sampling and estimation.
    • May use bootstrap to get variances of a complex designed sample: -bsweights- (IDEAS)creates the bootstrap weights for designs specified through and supported by svy:
      • bs4rw, rw(brrrwt*): qreg weight i.race if subpop==1 [pw=finalwgt], q(.75)
    • Started from version 13, -qreg- supports -pweight- and -iweight-. The 'bootstrap' has 'strata()' etc. options, even though 'bootstrap' is not designed for the complex survey data, the estimates are very similar to the estimates from the "withReplicates(design=xxx, quote(coef(rq(y ~ x,tau=0.5, weights=.weights))))" of R!.
    • Blog: Doing Bootstrap/Jackknife in Stata for complex survey data
    • Updates(3/3/2017): The better approach is to use 'svy jackknife' or 'svy bootstrap' with jackknife or bootstrap replicate weights. After the version 10, you don't need create jackknife replicate weights using user-written command -survwgt-, the -svy jackknife- can create the weights according to the info provided by -svyset-. You do need provide the bootstrap replicate weights for -svy bootstrap-, which can be created using the user-written command such as -bsweights-:
        • webuse nhanes2, clear
        • svyset psu [pw=finalwgt], strata(strata)
        • bsweights bs_, n(-1) reps(50) seed(4881269)
        • svyset [pw=finalwgt], bsrw(bs_*)
        • svy bootstrap _b: qreg weight i.race, q(.5)
    SAS
    Articles

    When It Comes To A1C Blood Test For Diabetics, One Level No Longer Fits All

    by Nancy Shute

     … If there's one thing that people with diabetes get pounded into their heads, it's that they've got to keep their A1C level under control. That's the blood glucose measure that's used to decide how well a person is managing their diabetes.

    But new diabetes management guidelines announced today will cut many people with diabetes some slack.

    Where old guidelines from the American Diabetes Association said that people should maintain an A1C of 7, the new guidelines say that patients should work with their doctors to determine an appropriate A1C target. …

    Full text: here

    Thursday, April 19, 2012

    Social Rank Affects Monkey Immunity

    Social Rank Affects Monkey Immunity
    Source: The Scientist


    "... the immune effects of rank were not permanent. Seven monkeys that changed rank showed a rapid change in gene expression to match their new status. The finding suggests that health depends on social status, and not vice versa...."


    Full text: here
    Original research article: here

    Wednesday, April 18, 2012

    Let Them Eat Dirt - The Scientist

    Let Them Eat Dirt
    Source: The Scientist

    I read this interesting article with great interest. It demonstrates the rightness of the view of my mom, grandma, great grandma, ..., all of them is/were not scientist for sure.
    "...Maybe it's okay to let your toddler lick the swing set and kiss the dog. A new mouse study suggests early exposure to microbes is essential for normal immune development, supporting the so-called "hygiene hypothesis" which states that lack of such exposure leads to an increased risk of autoimmune diseases. Specifically, the study found that early-life microbe exposure decreases the number of inflammatory immune cells in the lungs and colon, lowering susceptibility to asthma and inflammatory bowel diseases later in life. ..."

    Full text: here

    Tuesday, April 17, 2012

    Tools for Innovative Thinking in Epidemiology

    By Roberta B. Ness

    “Innovation is the engine of scientific progress. Concern has been raised by the National Academies of Science about how well America is sustaining its ‘‘creative ecosystem.’’ In this commentary, the author argues that we can all improve our ability to think innovatively through instruction and practice. The author presents a series of tools that are currently being taught in a curriculum developed at the University of Texas, based on earlier evidence-based creativity training programs. The tools are these: 1) finding the right question; 2) enhancing observation; 3) using analogies; 4) juggling induction and deduction; 5) changing your point of view; 6) broadening the perspective; 7) dissecting the problem; 8) leveraging serendipity and reversal; 9) reorganization and combination of ideas; 10) getting the most out of groups; and 11) breaking out of habitual expectations and frames. Each tool is explained using examples from science and public health. It is likely that each of us will identify with and agree with the usefulness of one or two of the tools described. Broader mastery of many of these tools, particularly when used in combination, has provided our students with a powerful device for enhancing innovation.”

    Read full text here

    Monday, April 16, 2012

    John Glenn's true hero - CNN.com

    John Glenn's true hero
    Source: CNN.com
    "...For half a century, the world has applauded John Glenn as a heart-stirring American hero. He lifted the nation's spirits when, as one of the original Mercury 7 astronauts, he was blasted alone into orbit around the Earth; the enduring affection for him is so powerful that even now people find themselves misting up at the sight of his face or the sound of his voice.
    But for all these years, Glenn has had a hero of his own, someone who he has seen display endless courage of a different kind:
    Annie Glenn.
    They have been married for 68 years.
    He is 90; she turned 92 on Friday.
    This weekend there has been news coverage of the 50th anniversary of Glenn's flight into orbit. We are being reminded that, half a century down the line, he remains America's unforgettable hero. ..."

    The full text here.

    Friday, April 13, 2012

    The Mediterranean Diet

    The Mediterranean Diet

    Dr. Eduardo Farinaro from Federico II University of Naples, Italy, gave us a great presentation about the lifestyle and CHD prevention. I learned more about the Mediterranean diet.

    What is the Mediterranean Diet?
    There may be no single Mediterranean diet; the Mediterranean diet is the traditional dietary patterns of Spain, southern Italy, Greece and specifically the Greek island of Crete, and parts of the Middle East. The major characteristics are a few I remember:
    • olive oil as a principle source of fat.
    • colorful veggies, and fruits, beans & nuts (legumes), and whole grains.
    • regular fish consumption.
    • herb and spicy seasonings, which will reduce the need of salt and fat.
    • moderate drink of wine with the meal. 
    Dr. Farinaro also mentioned the persons living in the Mediterranean diet area are also with lower level of anxiety, having a good relationship with family, and moderate physical activity. He did not mention much about dairy products.

    Mediterranean diet - Wikipedia, the free encyclopedia

    Advanced Query Syntax


    …”The Advanced Query Syntax (AQS) is used by WDS to help users and programmers better define and narrow their searches. Using AQS is an easy way to narrow searches and deliver better result sets. Searches can be narrowed by the following parameters:
    • File kinds: folders, documents, presentations, pictures and so on.
    • File stores: specific databases and locations.
    • File properties: size, date, title and so on.
    • File contents: keywords like "project deliverables," "AQS," "blue suede shoes," and so on.
    Furthermore, search parameters can be combined using search operators. The remainder of this section explains the query syntax, the parameters and operators, and how they can be combined to offer targeted search results. The tables describe the syntax to use with WDS, as well as the properties that can be queried for each file kind displayed in the Windows Desktop Search results window.”…

    How to enable  Advanced Query Syntax search:
    • Go to  Windows Explorer.
    • Click menu “Organize”.
    • Click “Folder And Search Options”.
    • Click “Search” tab.
    • Check “Use Natural Language Search”
    Using Advanced Query Syntax To Find Files in Windows 7 


    Wednesday, April 11, 2012

    Collected Websites and Online Tools

    Collected Websites and Online Tools (obsolete)
    Epidemiology and Statistics
    • Education
    • Inspiration
      • TED is a set of annual conferences that brings together some of the world's best and brightest thinkers to deliver talks on their realms of expertise.
      • TEDMED is a community of people who are passionate about imagining the future of health and medicine.
    • Travel
      • The Roadtrippers road trip planner helps you discover, book, and create travel itineraries of the best places and experiences along the way. Also, there are apps for handhold devices.
      • The airbnb helps you to rent unique places to stay from local hosts in 190+ countries.
      • Hipmunk lets you search for flights across major airlines, giving you easy-to-scan results in a grid sorted by agony ("a combination of price, duration and number of stops").
    • Money Saving
      • FatWallet: Save with coupons and deals - get cash back
      • Clark Howard: Advice You Can Trust. Money in Your Pocket
      • Caslist provides local classifieds and forums for jobs, housing, for sale, personals, services, local community, and events.
      • Car shopping: if you are looking for a car, you might visit these websites to get a good price:
        • Truecar, a hassle-free car-buying experience from a nationwide network of certified dealers.
        • U.S. News Best Cars, a best car, truck and SUV rankings and reviews from U.S. News.
        • Kelley Blue Book.
        • Edmunds - New cars, used cards, car reviews and car prices.
    • Health
    • File Utility
      • Smallpdf is a fast and powerful online converter; it can convert in both ways between PDF and files of MS-Office, also can compress PDF, unlock, merge and split PDF. There is no limits to file size, no ad watermarks - just a free and simple online PDF converter.
      • Any2DjVu Server is offered by DjVu Zone to convert pdf etc. into documents in DjVu format.
      • Extractpdf.com can extract Images, Text or EVEN Fonts from a PDF File.
      • Zamzar is an online format converter which allows to convert media between different formats. It can convert document, music, videos, images, and even archived files. The free service provides a file size up to 100 MB file size limit. It converts MOBI file quite well.
      • TransferBigFiles is helpful to send and receive files that are too big for email attachments. The free account allows you to send files that are as big as 100 MB.
      • SendThisFile can send a big file up to 2 GB for free, but you need create an account.
      • Dropbox has much more features but also can be used for big file transfer.
    • GPS
    • Miscellaneous
      • Copy-and-paste the URL on SaveFrom.net to download files from Rapidshare, FileFactory, Youtube, Google, and Metacafe. For Youtube, you can simply add "ss" after "http://" to download the video.
      • Mr. Number controls who can call you and when with status, blocking, and caller ID for mobile phones.
      • Video conference/chat
      • Zendesk is a calming music source.
      • Grooveshark is a great place to listen to music
      • OpenDNS is the leading provider of Internet security and DNS services. It  protects kids from online violence, pornography, and other unsavory Web material.
      • How to make your own Rivnut tool and install the Pilot running board by yourself:
      • Online Color Palettes Generator
        • PHOTOCOPA from ColourLovers is an advanced color palette tool that helps you create the perfect color palette.
        • Pictaculous is a simple color palette generator and give you HTML hex codes.
        • Kuler by Adobe is a web-hosted application for generating color themes.
        • Color hunter creates and finds color palettes made from images
        • Color Palette Generator can generate a color palette based on an online image.
        • Color Scheme Designer allows you to create various color schemes and export them.
        • You can also use GIMP (Filters/Blur/Pixelize..., or to open the Palettes dialog, go to Windows > Dockable Dialogs > Palettes, then right-click anywhere in the Palettes, select import, the palette file (*.gpl) can be find under a palette folder.) to create one.

    Friday, April 06, 2012

    Choosing Wisely

    Choosing Wisely
    Choosing Wisely aims to promote conversations between physicians and patients by helping patients choose care that is:
    • Supported by evidence
    • Not duplicative of other tests or procedures already received
    • Free from harm
    • Truly necessary

    Wednesday, April 04, 2012

    How to Convert Google Maps Direction into GPX file

    How to Convert Google Maps Direction into GPX file
    • Go to Google Maps and get the direction.
    • Click ‘Link’ (chain shape icon) at the right-upper corner of left panel.
    • Copy the URL (press Ctrl-C).
    • Go to GPSVisualizer.
    • Click ‘Convert to GPX’ under ‘To set more options, use the detailed input pages:’.
    • Select ‘GPX’ under ‘Output format: ’.
    • Paste the URL (press Ctrl-P) under ‘Or provide the URL of a file on the Web:’.
    • Click ‘Convert’.
    • Click the linkage labeled as ‘Click to download xxx.gpx’ to save the converted GPX file.

    Now, you can upload the GPX file to a GPS unit.

    Tuesday, April 03, 2012

    Study Says DNA’s Power to Predict Illness Is Limited - NYTimes.com

    Study Says DNA's Power to Predict Illness Is Limited
    By Gina Kolata of the New York Times
    ...
    If every aspect of a person's DNA is known, would it be possible to predict the diseases in that person's future? And could that knowledge be used to forestall the otherwise inevitable?
    The answer, according to a new study of twins, is, for the most part, "no."
    ...

    Full Text: here
    Original Research Article: The Predictive Capacity of Personal Genome Sequencing

    Friday, March 30, 2012

    Fungal Fruiting Bodies and Fanatics

    Source: Science
     …”Mushrooms are the sex organs of fungi. They are ballistics experts that emerge when the fungus is ready to reproduce, launch spores by the billion, and vanish. Or rather, they puff up and deflate. The sudden appearance of mushrooms on a lawn or under a log, like many illusions, is achieved with extensive advance setup and hydraulics. After a spore germinates, it sends filaments out underground in all directions in search of food and other fungi. When two fungal colonies—or three or more, as fungi are substantially less constrained than animals—of the same species meet, their cells merge and their DNA combines in the mushroom version of mating. New spores are produced, and the cells of the future mushroom are organized around them. This process occurs at the tips of the filaments, accounting for mushrooms' quirk of appearing in rings. When the conditions are right, water rushes in and pressurizes the assembly, swelling the cells and inflating the mushroom. In many species, that takes only a few hours, the spores are soon released, and the mushroom shrivels by sundown. Others survive a week or more, and some tougher forms may last for months. “…
    full text: here


    Wednesday, March 21, 2012

    Exercise: 八段锦

    Exercise: 八段锦 (Baduanjin)
    from Wikipedia


    Full Article in Chinese
    ...
    八段锦(Ba Duan Jin)是一种在中国古代发明的健身方法,由八种肢体动作组成,内容包括肢体运动和气息调理。八段锦有人认为是气功的一种。也有演變成中国武术一种。


    八段锦和五禽戏、太极拳等,都是中国民间广为流传的健身方法。1982年6月28日,中国卫生部、教育部和当时的国家体育委员会发出通知,把八段锦等中国传统健身法作为在医学类大学中推广的"保健体育课"的内容之一。2003年中国国家体育总局把重新编排后的八段锦等健身法作为"健身气功"的内容向全国推广。


    "八段锦"这个名字,一般认为有两层意思:1、表示这是一种集锦多种练习方法的功法;2、源自一种名为"八段锦"的织锦,表示练习时动作连
    ...
    Full Article in English
    ...
    The Baduanjin (simplified Chinese: 八段锦气功; traditional Chinese: 八段錦氣功; pinyin: Baduànjin qìgong) is one of the most common forms of Chinese qigong used as exercise. Variously translated as Eight Pieces of Brocade, Eight Section Brocade, Eight Silken Movements and others, the name of the form generally refers to how the eight individual movements of the form characterize and impart a silken quality (like that of a piece of brocade) to the body and its energy. The Baduanjin is primarily designated as a form of medical qigong, meant to improve health. This is in contrast to religious or martial forms of qigong. However, this categorization does not preclude the form's use by martial artists as a supplementary exercise, and this practice is frequent.
    ...

    Friday, March 09, 2012

    How to do a trend analysis in Stata

    Tips - Stata: How to do a trend analysis in Stata

    • -nptrend- performs the nonparametric test for trend across ordered groups.
        .nptrend exposure, by(grp)
        also see How can I test for a trend across a categorical variable?
    • -vwls- estimates a linear regression using variance-weighted least squares.
        .vwls prev year,sd(se_prev)


    Where can we find the citation number of our published article?

    Where can we find the citation count of our published articles?

    • Go to the Web of Knowledge.
    • Click on the tab of Web of Science.
    • Click on the sub-tab of Advance Search.
    • Use your name and some restrictions (e.g. AU=(Cheng, YJ) AND OG=(XYZ))
    • Double-check and exclude the articles not published by yourself.
    • Click the Create Citation Report on the up-right corner of the first article (if you still cannot find it, press Ctrl-F, and type create citation on that webpage).
    • Click and you get and play around the report.
    There are also free citation count search engines:
    Related articles: 

    Wednesday, March 07, 2012

    Sex-Specific Reporting of Scientific Research A Workshop Sum...

    Sex-Specific Reporting of Scientific Research: A Workshop Summary

    Editors

    Institute of Medicine (US) Board on Population Health and Public Health Practice.

    Source

    Excerpt

    On August 30, 2011, the Institute of Medicine hosted a workshop, Sex-Specific Reporting of Scientific Research, sponsored by the Office of Research on Women's Health (ORWH) of the National Institutes of Health (NIH). The workshop explored the need for sex-specific reporting of scientific results; potential barriers and unintended consequences of sex-specific reporting of scientific results; experiences of journals that have implemented sex-specific requirements, including the challenges and benefits of such editorial policies; and steps to facilitate the reporting of sex-specific results. Presenters and participants included current and former editors of scientific journals, researchers, and scientists and policymakers from government, industry, and nonprofit organizations. Presentations and discussions highlighted the importance to both women and men of having sex-specific data, the problems with sample size and financial constraints for conducting the research, the appropriateness of sex-specific analyses, and the limitations of journal policies to change experimental designs. During closing remarks, the planning committee chair summarized some of the individual suggestions discussed for advancing sex-specific reporting as: identifying the sex of populations in journal populations, sharing of sex-identified raw data, giving extra credit in review to manuscripts that include sex-specific information, and requiring sex-stratified analyses where applicable.
    Copyright © 2012, National Academy of Sciences.
    PMID:22379657[PubMed]

    Thursday, February 23, 2012

    Tips - Stata: How to get rate

    Tips – Stata: How to get rates by multiple variables for complex sampling designed data (-svy-)

    If one wants to get the rates of variable 'dmb20' (0, 1) among adults with 'DM' by 'survey' and 'age3grp', he/she can use different ways to get them, three basic approaches are listed below:  

    1. Use –subpop-
    .svy, subpop(if DM==1 & age3grp==1): tab survey dmb20, obs row percent ci format(%5.1f)
    .svy, subpop(if DM==1 & age3grp==2): tab survey dmb20, obs row percent ci format(%5.1f)
    .svy, subpop(if DM==1 & age3grp==3): tab survey dmb20, obs row percent ci format(%5.1f)

    2. Use –proportion-
    .svy, subpop(if DM==1): proportion dmb20, over(survey age3grp)

    3. Use –ratio-
    .svy, subpop(if DM==1): ratio (dmb20/DM), over(survey age3grp)

    NOTES: The better part of -svy: tab- is using a logit transform to produce confidence intervals of estimates, which makes the confidence interval always between 0 and 1.

    However, the one advantage of using 2 & 3 is you can use post estimation commands, such as -testnl- or -nlcom-, flexibly.

    we also can use -svy: total- to get the total numbers like use -count- of -svy: tab-, and followed by the post estimation commands.

    Thursday, February 09, 2012

    Tips - Stata: Building complicated expressions the easy way

    Tips - Stata: Building complicated expressions the easy way


    Step-by-step:
    • run a command of analysis
    • .db display
    • click 'Create...'
    • use 'expression builder' to create the complicated formula. It will help to use correct expressions
    • click 'ok' and 'submit'.
    • then, copy and paste the formula to a 'do' or 'ado' file for further use.

    You can find a more detailed article here

    Tuesday, February 07, 2012

    Objective measurement of physical activity: best practices and future directions

    Objective Measurement of Physical Activity:  Best Practices and Future Directions

    source: Medicine & Science in Sports & Exercise


    This journal supplement summarizes and builds upon a workshop which convened researchers from diverse sectors and organizations to critically review the state-of-the-science.


    The supplement discusses current technologies for objective physical activity monitoring, provides recommendations for the use of these technologies, and explores future directions in the development of new tools and approaches. It presents best practices for using physical activity monitors in population-based research, explores modeling of physical activity outcomes from wearable monitors, and discusses statistical considerations in the analysis of accelerometry-based activity monitor data. It also examines monitor equivalency issues and discusses current use and best practices for accelerometry with particular populations—children, older adults, and adults with functional limitations. 


    Open-access, full-text of all articles is available at here.

    Tips - Stata: function and extended function to -generate- and -egen-

    Tips - Stata: function vs. extended function & -generate- vs. -egen-


    Stata provids two kinds of functions: regular functions and extended functions (or called egen function). These functions need to be used with other Stata commands, usually -generate- and -egen-. -generate- is for regular function, or -egen- for egen function and only -egen- may be used to run egen function. some function may look similar but different:


    • sum(var) and total(var) (a -egen- function)with -bysort-
      • Sum() is a regular function. When you use .gen sum1=sum(var), it will generate a new variable named 'sum1' with cumulative summation of 'var' from top to bottom in order of group.
      • However, total() as a egen function used in .egen sum2=total(var), it will generate a new variable named 'sum2' with summation of 'var' of all observation from top to bottom in that group. All the cases in that group have the same values of 'sum2'.
    • recode(var,cutpt1,cutpt2,cutpt3,...),  irecode(var,x1,x2,...,xn) and group(varlist) (a -egen- function)



    Thursday, February 02, 2012

    Phys Ed: Exercise as Housecleaning for the Body - NYTimes.com

    Exercise as Housecleaning for the Body
    source: New York Times
    ... More striking, when Dr. Levine stuffed both groups of animals with high-fat kibble for several weeks until they developed a rodent version of diabetes, the normal mice subsequently reversed the condition by running, even as they continued on the fatty diet. The autophagy-resistant animals did not. After weeks of running, they remained diabetic. Their cells could not absorb blood sugar normally. They also had higher levels of cholesterol in their blood than the other mice. Exercise had not made them healthier.
    In other words, Dr. Levine and her colleagues concluded, an increase in autophagy, prompted by exercise, seems to be a critical step in achieving the health benefits of exercise. ...

    Original article published in Nature