Announcement

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

  • Problem with using margins

    Dear statalist

    I have a problem using margins on stata command.
    I'm doing some research related to the effect of election on corporate investment.

    I generate control variables called victory (which is defined as the numbers of vote that the winner got from the election) and difofvote (vote difference between the winner and the running-up).
    My problem is that I want to create another dummy variable called "Close" that sets to one if the vote difference(difofvote) between the winner and the running-up is below the 25th percentile of the (victory) margin distribution. I'm new to use margins, so I'm not sure.

    Here are my codes:
    reg difofvote victory, allbaselevels
    margins, dydx(victory) at((p25) victory)


    Can anyone here help me please.
    Thank you!

  • #2
    Welcome to Statalist.

    You have accidentally posted your topic in Statalist's Mata Forum, which is used for discussions of Stata's Mata language, which is different than Stata's command language. Your question will see a more appropriate, and much larger audience if you post it in Statalist's General Forum.

    Also, if you have not already done so, take a look at the Statalist FAQ linked to at the top of this page for posting guidelines and suggestions.

    Comment

    Working...
    X