Announcement

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

  • Using IV for count data with diff-in-diff specification

    I want to estimate a count data model (the dependent variable is patents count) with a continuous diff-in-diff specification ("natural experiment"). I have a small sample (N=16, T=30). The main regression is:

    Code:
    gen treatment_post=treatment*post
    xtpoisson patents treatment_post i.year,fe vce(robust)
    In one of the robustness checks, I would like to instrument my treatment variable. My IV (like my treatment) is time invariant. Currently, I'm using the following command

    Code:
    gen iv_post=iv*post
    ivpoisson gmm patents (treatment_post=iv_post) i.year i.group, vce(robust)
    However, I saw in previous posts that this estimator might not be consistent (due to incidental parameters problem). I would be happy to get suggestions about the right direction. (In an old post, Jeff Wooldridge suggested: "to add the fixed effects residuals obtained in the first stage to the FE Poisson estimation in the second stage". I'm not sure if it works when the instrument is time-invariant and in general how exactly to implement that method (e.g., how to calculate the standard errors)).


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte group int year float post double(patents treatment) float iv
    2 1971 1  3 .19008264462809918 14.162823
    2 1964 0  1 .19008264462809918 14.162823
    2 1962 0  1 .19008264462809918 14.162823
    2 1951 0  0 .19008264462809918 14.162823
    2 1955 0  0 .19008264462809918 14.162823
    2 1970 1  3 .19008264462809918 14.162823
    2 1978 1  0 .19008264462809918 14.162823
    2 1954 0  1 .19008264462809918 14.162823
    2 1968 1  3 .19008264462809918 14.162823
    2 1948 0  2 .19008264462809918 14.162823
    2 1977 1  0 .19008264462809918 14.162823
    2 1973 1  2 .19008264462809918 14.162823
    2 1950 0  1 .19008264462809918 14.162823
    2 1960 0  0 .19008264462809918 14.162823
    2 1979 1  1 .19008264462809918 14.162823
    2 1972 1  1 .19008264462809918 14.162823
    2 1963 0  0 .19008264462809918 14.162823
    2 1984 1  1 .19008264462809918 14.162823
    2 1981 1  1 .19008264462809918 14.162823
    2 1983 1  1 .19008264462809918 14.162823
    2 1974 1  2 .19008264462809918 14.162823
    2 1949 0  0 .19008264462809918 14.162823
    2 1965 1  3 .19008264462809918 14.162823
    2 1980 1  1 .19008264462809918 14.162823
    2 1957 0  0 .19008264462809918 14.162823
    2 1958 0  0 .19008264462809918 14.162823
    2 1953 0  2 .19008264462809918 14.162823
    2 1966 1  6 .19008264462809918 14.162823
    2 1956 0  0 .19008264462809918 14.162823
    2 1967 1  2 .19008264462809918 14.162823
    2 1961 0  2 .19008264462809918 14.162823
    2 1975 1  3 .19008264462809918 14.162823
    2 1982 1  2 .19008264462809918 14.162823
    2 1985 1  0 .19008264462809918 14.162823
    2 1952 0  1 .19008264462809918 14.162823
    2 1976 1  1 .19008264462809918 14.162823
    2 1969 1  3 .19008264462809918 14.162823
    2 1959 0  1 .19008264462809918 14.162823
    4 1973 1  0  .3243243243243243 13.913777
    4 1969 1  1  .3243243243243243 13.913777
    4 1976 1  0  .3243243243243243 13.913777
    4 1953 0  0  .3243243243243243 13.913777
    4 1979 1  4  .3243243243243243 13.913777
    4 1956 0  0  .3243243243243243 13.913777
    4 1958 0  0  .3243243243243243 13.913777
    4 1963 0  0  .3243243243243243 13.913777
    4 1978 1  0  .3243243243243243 13.913777
    4 1977 1  1  .3243243243243243 13.913777
    4 1974 1  0  .3243243243243243 13.913777
    4 1961 0  1  .3243243243243243 13.913777
    4 1966 1  1  .3243243243243243 13.913777
    4 1980 1  0  .3243243243243243 13.913777
    4 1955 0  1  .3243243243243243 13.913777
    4 1965 1  1  .3243243243243243 13.913777
    4 1982 1  0  .3243243243243243 13.913777
    4 1975 1  0  .3243243243243243 13.913777
    4 1967 1  3  .3243243243243243 13.913777
    4 1957 0  0  .3243243243243243 13.913777
    4 1949 0  2  .3243243243243243 13.913777
    4 1951 0  0  .3243243243243243 13.913777
    4 1968 1  1  .3243243243243243 13.913777
    4 1972 1  0  .3243243243243243 13.913777
    4 1954 0  0  .3243243243243243 13.913777
    4 1981 1  0  .3243243243243243 13.913777
    4 1950 0  1  .3243243243243243 13.913777
    4 1960 0  0  .3243243243243243 13.913777
    4 1971 1  0  .3243243243243243 13.913777
    4 1985 1  0  .3243243243243243 13.913777
    4 1962 0  0  .3243243243243243 13.913777
    4 1983 1  0  .3243243243243243 13.913777
    4 1952 0  0  .3243243243243243 13.913777
    4 1970 1  0  .3243243243243243 13.913777
    4 1984 1  0  .3243243243243243 13.913777
    4 1959 0  2  .3243243243243243 13.913777
    4 1964 0  0  .3243243243243243 13.913777
    4 1948 0  1  .3243243243243243 13.913777
    5 1979 1  3   .216072545340838 12.584287
    5 1951 0  0   .216072545340838 12.584287
    5 1968 1  9   .216072545340838 12.584287
    5 1963 0  0   .216072545340838 12.584287
    5 1948 0  3   .216072545340838 12.584287
    5 1960 0  6   .216072545340838 12.584287
    5 1952 0  0   .216072545340838 12.584287
    5 1955 0  1   .216072545340838 12.584287
    5 1985 1  2   .216072545340838 12.584287
    5 1949 0  0   .216072545340838 12.584287
    5 1974 1 14   .216072545340838 12.584287
    5 1969 1 15   .216072545340838 12.584287
    5 1978 1  0   .216072545340838 12.584287
    5 1967 1 18   .216072545340838 12.584287
    5 1982 1  2   .216072545340838 12.584287
    5 1966 1 24   .216072545340838 12.584287
    5 1984 1  1   .216072545340838 12.584287
    5 1964 0  3   .216072545340838 12.584287
    5 1975 1  4   .216072545340838 12.584287
    5 1956 0  1   .216072545340838 12.584287
    5 1983 1  2   .216072545340838 12.584287
    5 1971 1  2   .216072545340838 12.584287
    5 1981 1  0   .216072545340838 12.584287
    5 1959 0  1   .216072545340838 12.584287
    end
    Last edited by muly san; 15 Jul 2018, 14:45.

  • #2
    I will be happy to provide more details

    Comment

    Working...
    X