Announcement

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

  • Restricting data of patient ID to perform 1 test at a time rather than all of them

    Good Afternoon,

    If anyone could give me advice I would really appreciate that. I know it is going to be something very basic or a command I just haven't come across before. I have seperated my patient ID as seen in column 1. I want to run a Wilcoxon signed rank test on on patient 1 between chemostage 0 and 2 (should be 1), and then 2-3 to see if there's a difference in my GLS variable and EF variable.

    How do I separate the patients when running the tests? rather than what's been happening where it's run all of the patients I have on my dataset. (I will also need to separate the chemostages. But hopefully this is similar)

    Hope you're able to help! i would appreciate it!


    Attached Files

  • #2
    Welcome to Statalist.

    To start with, you are going to find it difficult to run anything on one patient_id at a time, because your patient_id is missing on most of your observations. You should start by filling the missing values in your patient_id variable.
    Code:
    replace patient_id = patient_id[_n-1] if missing(patient_id)
    Beyond that, it is difficult to help without knowing more about your data and the command(s) you used to run the test. When you registered for Statalist, you were advised to take a few moments to review the Statalist FAQ linked to from the top of every Statalist page. Note especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using code delimiters [CODE] and [/CODE], and to use the dataex command to provide sample data, as described in section 12 of the FAQ. It's particularly unhelpful to post a screen shot.

    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    You will want to provide a variable list to the dataex command to just present variables that are used in the Wilcoxon test, something like
    Code:
    dataex patient_id chemostage GLS EF in 1/25
    which will provide your first 25 observations in a usable form for testing any advice we can provide.

    In the same way that you gather echocardiography data from your patient in order to test a provisional patient assessment, rather than boldly assert a conclusion lacking data, analysts test their analysis plan on real data rather than boldly assert that the analysis plan will do what is desired.

    Comment


    • #3
      Hi,

      Oh sorry about that. Statistics isn't my strongest area. But anyway, I am using the Stata 16.1 software.
      Commands I have tried so far are:

      [CODE]
      [signrank gls_lv_average = patient_id/CODE]

      (the first picture),this gave all of the observations. Then tried

      [CODE]
      [signrank gls_lv_average = chemostage/CODE](second picture) and lastly did this [CODE]
      [signrank gls_lv_average = patient_id/CODE] again bracketing the patient number I wanted to run a test on (third image). This last command didn't like the use of brackets

      The data I'm using is string and numerical e.g. GLS is numerical while date, initials, MR severity are string. Both the variables I'm wanting to use are numerical.

      I found a time series or
      Code:
      [tsset
      However, I do not think this is the command I am after. I have still been searching, however not finding much.

      Hope that's a little more helpful! Thank you!






      Last edited by Ellie Wizard; Yesterday, 11:24.

      Comment

      Working...
      X