Announcement

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

  • help with sreg command and scaling variables using "p."

    Hi fellow STATA users! I have 2 main questions with a do file I have inherited
    Question 1 I am trying to run a series of multivariable linear regressions, but the do file I have has a structure I am not familiar with. It is as follows:
    sreg reg.lin i.block block jblock jblock4 //
    p.50.scoremod i.score p.50.scoreadv //
    outcome(A_MEC B_MEC C_MEC) ///
    adjust(c.gender c.score i.structure i.bkgrnd)
    This is not how I typically write multivariable linear regression scripts at all, and when I run this, it tells me: command sreg is not recognized. Is there a software package I don't have? I tried installing sreg but this is not an option.
    Question 2. scoremod is a continuous variable on a very large scale (1-10,000) . I would like to have this variable per 50 additional points (rather than per every single additional point).
    The do file I have has done this by writing "p.50" in front of the scoremod variable. But this doesn't run in STATA. Is there a software for this, or is there another way of 'scaling' this variable?

    Thanks everybody for any help you can be!



  • #2
    I am not familiar with sreg and the -p.- syntax is not standard in official Stata. -i.- on the other hand indicates a factor variable, see

    Code:
    help fvvarlist
    A few points that may be helpful are the following:

    Question 1 I am trying to run a series of multivariable linear regressions, but the do file I have has a structure I am not familiar with. It is as follows:
    1. The multivariate regression command in Stata is mvreg. See

    Code:
    help mvreg
    Question 2. scoremod is a continuous variable on a very large scale (1-10,000) . I would like to have this variable per 50 additional points (rather than per every single additional point).
    2. In Stata, you do the rescaling manually before including the variable in the regression. Therefore, you need something like:

    Code:
    gen scoremod2= scoremode/50
    sum scoremod2
    This variable "scoremode2" should now range from 1/50= 00.2 to 10,000/50= 200 and it is what you now include in the regressions. If you are thinking about binning the values of the variable into integer values with units of 50, you may also do that, but that entails loss of information which is not a good thing from a statistical perspective.
    Last edited by Andrew Musau; 20 Jun 2022, 08:41.

    Comment


    • #3
      I am also not familiar with -sreg-; where did you get it

      re: Q1 - I note that I do not interpret multi-variable as the same as multivariate as Andrew Musau does; see Hidalgo, B and Goodman, M (2013), "Multivariate or Multivariable Regression?" , Am J Public Health, 103(1): 39-40

      Comment

      Working...
      X