Announcement

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

  • Replacing missing values in baseline with other specified observations

    Hi,

    So I've been provided with this dataset to analyse and there are two observations for each time point depending on derivation(or lack of used), As below:

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	4.2 KB
ID:	1371356



    The baseline values with aOC dtype are empty, while those with empty dtype are present. This the case for hundreds of different IDs. How can I replace the missing baseline values with the values present in the 'missing' dtype cells without having to copy/paste hundreds of times. I only want to replace the baseline values, and leave other time points as is.

    I hope that made sense. Thanks in advance!
    Last edited by Sara Hussein; 23 Jan 2017, 09:49.

  • #2
    The image is not readable (by me).

    What we need is text showing example data. http://www.statalist.org/forums/help#stata explains how.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      The image is not readable (by me).

      What we need is text showing example data. http://www.statalist.org/forums/help#stata explains how.
      Sorry about that, I've changed it now to text. Hope that works.

      Comment


      • #4
        Sara:
        unfortunately, no improvement occurs vs your previous post.
        As per Nick's suggestion, please see help dataex-. Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Really sorry, I have now uploaded a photo of the data.

          Comment


          • #6
            Photos in general are deprecated: do please note what is said at the link in #2.

            This is pertinent: http://www.stata-journal.com/sjpdf.h...iclenum=dm0043

            Perhaps

            Code:
            bysort usubjid : replace bcva_se = bcva_se[3 - _n] if missing(bc_vase) & visit == "BASELINE"

            Comment

            Working...
            X