Announcement

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

  • bsvalidation "invalid syntax"

    Hi,

    My first time posting here so please let me know if I've done anything incorrectly.

    I have just discovered the new user-written command 'bsvalidation' for performing internal validation of prognostic models.

    Having read the help manual and Stata Journal article, I tried to implement it but it returns the error r(198) 'invalid syntax'.

    I created a test dataset and it works. I also ran a univariate logistic model with my data and it ran. My model has 10 categorical main effects only.

    I am unsure what is going wrong. I have uploaded my simple do file and my data (with all other variables removed to reduce size).

    Any tips would be greatly appreciated.

    Kind regards,

    Lucy Bromley
    Attached Files

  • #2
    Hi Lucy,

    I'm in a similar situation - just tried using bsvalidation and had the same error. I also have several categorical variables included in the logistic model.

    Did you end up finding a solution?

    Thanks,

    Tyrone

    Comment


    • #3
      Hi Lucy and Tyrone,

      I think the problem is the number of factor variables included. Unfortunately, the command works with (a maximum of) four factor variables.
      You could include the dichotomous variables (coded as 0 and 1) without "i.", and the other four variables as factor (i.varname).

      logistic livebirth malefactor ovulatory eggcat i.trancat i.hist treat embcat i.age endo i.ivfcycles

      Another option is to create the dummy variables as follows:

      tab age, gen(age)
      tab ivfcycles , gen(ivfcycles)
      tab hist , gen(hist)
      tab trancat , gen(trancat)
      logistic livebirth malefactor ovulatory eggcat (age2 age3 age4 age5 age6) (hist2 hist3) (ivfcycles2 ivfcycles3 ivfcycles4 ivfcycles5 ivfcycles6) treat embcat (trancat2 trancat3) endo
      bsvalidation


      I will try to find a better solution for this issue.

      I hope this helps you.

      Best regards
      Borja

      Comment

      Working...
      X