Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating egfr using creatinine

    Dear users

    Can you please someone share their experience of using the stata module written by phil clayton to calculate egfr from creatinine. https://ideas.repec.org/c/boc/bocode/s457731.html
    I have installed this module but cannot understand the syntax I should be using to generate the egfr using creatinine, gender and age information. Can someone please help ?

    Thanks

  • #2
    I've had no prior experience with it, but its syntax seems pretty straightforward. Here's an example that illustrates its use with a formula that requires only age and sex. Begin at the "Begin here" comment; the first part of the code just downloads the module from SSC and creates a fictional toy dataset for use in illustration.

    .ÿ
    .ÿversionÿ16.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿsetÿseedÿ`=strreverse("1529598")'

    .ÿ
    .ÿlocalÿSSCÿhttp://fmwww.bc.edu/repec/bocode/e/

    .ÿ
    .ÿforeachÿfileÿinÿadoÿsthlpÿ{
    ÿÿ2.ÿÿÿÿÿÿÿÿÿcopyÿ"`SSC'egfr.`file'"ÿ"`c(pwd)'/egfr.`file'",ÿreplace
    ÿÿ3.ÿ}

    .ÿ
    .ÿquietlyÿsetÿobsÿ5

    .ÿ
    .ÿgenerateÿbyteÿageÿ=ÿruniformint(21,ÿ65)

    .ÿlabelÿvariableÿageÿ"Patient'sÿageÿ(y)"

    .ÿ
    .ÿgenerateÿdoubleÿcreÿ=ÿruniform(0.5,ÿ2.5)

    .ÿlabelÿvariableÿcreÿ"Serumÿcreatinineÿlevelÿ(mg%)"

    .ÿformatÿcreÿ%03.1f

    .ÿ
    .ÿgenerateÿbyteÿsexÿ=ÿruniformint(0,ÿ1)

    .ÿlabelÿdefineÿSexesÿ0ÿMÿ1ÿF

    .ÿlabelÿvaluesÿsexÿSexes

    .ÿlabelÿvariableÿsexÿ"Patient'sÿsexÿ(1ÿ==ÿis-female)"

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿegfrÿ,ÿformula(mayo)ÿcreatinine(cre)ÿfemale(sex)ÿage(age)ÿusÿgenerate(gfr)

    eGFRÿcalculatedÿforÿ5ÿobservations.ÿValuesÿrangeÿfromÿ25ÿtoÿ116ÿmL/min.

    .ÿformatÿgfrÿ%3.0f

    .ÿ
    .ÿlist,ÿnoobs

    ÿÿ+-----------------------+
    ÿÿ|ÿageÿÿÿcreÿÿÿsexÿÿÿgfrÿ|
    ÿÿ|-----------------------|
    ÿÿ|ÿÿ47ÿÿÿ1.2ÿÿÿÿÿMÿÿÿÿ86ÿ|
    ÿÿ|ÿÿ53ÿÿÿ2.3ÿÿÿÿÿFÿÿÿÿ25ÿ|
    ÿÿ|ÿÿ29ÿÿÿ1.1ÿÿÿÿÿMÿÿÿ116ÿ|
    ÿÿ|ÿÿ56ÿÿÿ1.8ÿÿÿÿÿFÿÿÿÿ37ÿ|
    ÿÿ|ÿÿ24ÿÿÿ1.5ÿÿÿÿÿFÿÿÿÿ60ÿ|
    ÿÿ+-----------------------+

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Thank you Joseph,, this seems to work very well.

      Comment

      Working...
      X