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

  • Comparing two models

    Dear Statalist,

    I have the following variable:

    kVp Freq. Percent Cum.
    80 20 0.03 0.03
    90 30 0.05 0.08
    100 11,999 18.03 18.1
    110 1,202 1.81 19.91
    120 45,807 68.83 88.74
    130 5,049 7.59 96.32
    135 1,037 1.56 97.88
    140 1,411 2.12 100
    Total 66,555 100

    I looked at its effect in two ways:
    as a continues variable:
    xtset SurveyID_code
    xtgee CTDI  kVp   ,  corr(exchangeable) vce(robust)
    as a discrete variable:
    xtset SurveyID_code
    xtgee CTDI  i.kVp   ,  corr(exchangeable) vce(robust)

    How can I compare these two models and find out which one is the correct one?

  • #2
    I would, for each model, separately use -predict- to get the model predicted values and then make a scatter plot of those predicted values against the observed values. A visual comparison of the two graphs may make it obvious which model is superior. (It is highly unlikely that either model is "correct.")

    So a sequence something like this:

    xtgee CTDI kVp, corr(exch) vce(robust)
    predict pred_continuous
    label var pred_continuous "Continuous kVp"
    xtgee CTDI i.kVp, corr(exch) vce(robust)
    predict pred_discrete
    label var pred_discrete "Discrete kVp"
    graph twoway scatter pred_* CTDI || line CTDI CTDI
    A perfectly fitting model would fall exactly along the diagonal line.

    This might give a clear sense of which model fits the data better. If neither model is obviously better fit than the other, then you might want to consider other factors. For example, if other values of kVp besides the ones you have in your data are possible, the continuous model would extend by interpolation (or with much less reliability, by extrapolation) to those, whereas the discrete model has nothing to offer. The continuous model is also simpler.
    Last edited by Clyde Schechter; 14 Aug 2017, 22:01.


    • #3
      Thanks for the reply. I'm sure other values of kVp are not possible.

      I will have a look at scatter plots.


      • #4
        Last edited by Masoumeh Sanagou; 14 Aug 2017, 23:02.