Announcement

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

  • Forvalues question

    Hello,

    I just want to check I have got some code right that I had been having some problems with

    I am using the Feudtner Chronic complex stata code (https://feudtnerlab.research.chop.edu/ccc_version_2.php)

    Part of the temaplate code is: (see below for instructions)
    forvalues i=1/`n_dxs' {
    replace dx_count = dx_count + 1 if `dx'`i'!=""
    }

    I have 30 diagnosis variables (dx1-30)

    I think the correct code for my data is -

    forvalues i=1/30 {
    replace dx_count = dx_count + 1 if dx`i'!=""
    }

    as it doesn't work if I leave `dx' in the second line. Is this correct?

    Does that look right? Really grateful for any help with this!

    Thanks
    Hannah

    /*
    Program call statement: |
    | ccc dt_out dx n_dxs pc n_pcs icdv |
    | |
    | NOTE: The variables containing the ICD codes MUST follow the naming |
    | convention of a prefix followed by sequential numbers, i.e. dx1, dx2, dx3 |
    | |
    | Parameter definitions: |
    | |
    | dt_out: File name for output data; will be annoted with "_ccc" |
    | |
    | dx: ICD-9-CM or ICD-10 variable prefix name following naming |
    | convention prefix# (i.e. dx1, dx2, ...) |
    | |
    | n_dxs: Number of ICD-9-CM or ICD-10 variables in data set |
    | |
    | pc: ICD-9-CM procedure or ICD-10 procedure variable prefix name |
    | following naming convention prefix# (i.e. pc1, pc2, ...) |
    | |
    | n_pcs: Number of ICD-9-CM or ICD-10 procedure variables in data set |
    | |
    | icdv: ICD revision 9 or 10 |
    | |
    |************************************************* ****************************|
    | Examples: |
    | |
    | 1. Apply CCC v2 to array of ICD-9-CM diagnostic and procedural codes |
    | named dx1-dx5 and px1-px3: |
    | |
    | ccc output_file_name dx 5 px 3 9 |
    | |
    | 2. Apply CCC v2 to array of ICD-10 diagnostic and procedural codes |
    | named diag1-diag10 and proc1-proc7: |
    | |
    | ccc output_file_name diag 10 proc 7 10 |
    */

  • #2
    Hello Hannah,

    It looks like the CCC code you are referring too isn't meant to be modified by you. Unless you have good reason, don't think of this as a "temaplate," think of it as an add on to stata. I would try opening an unmodified version of the code and running it. It should execute without error, and it does on mine (V 15.1). This will load a new Stata command into memory called "ccc". Now you should be able to run the "ccc" command by passing in the parameters defined in the comments. The exact line should be based on the instructions in the comments at the top of the page, but it should look something like this:

    Code:
    ccc output_file_name dx 30 px 3 9
    Last edited by Daniel Schaefer; 08 Mar 2020, 21:22.

    Comment


    • #3
      Another thing to note; your variable names have to follow the naming conventions defined in this program. Hope that helps.

      Comment


      • #4
        The URL in #1 leads to a do-file that defines a program ccc. I see no help file.

        I agree with Daniel Schaefer: Looking at the code I see that it creates various variables on your behalf. Their names are wired into the code.

        That could be unproblematic, but the downside is that if something goes wrong you may need to read a lot of code to work out why.

        Comment


        • #5
          Thank you so much Daniel and Nick. You are totally correct and it now seems to be working. Very much appreciate your help.

          Comment

          Working...
          X