Hi all,

I am trying to determine whether the effect of income (continuous var) on cash usage depends on credit card ownership (categorical).Also, whether the effect of education (categorical var) on cash usage depends on credit card ownership. I am using interaction terms income*credit and educat*credit.

When I type the following code, I get an error message saying “”incometh: factor variables may not contain nonifnteger values.” Q1) Why might this be happening and is there a command i can use to fix this?


Code:
reg cashshare age i.credit##c.incometh i.educat##i.credit
margins incometh, at(credit = (0 1))
marginsplot, recastci(rarea)
Q2) When I run the next code for educate*credit, there is a heavy overlap of lines - is there any recommendation to help resolve this please?

Code:
reg cashshare age i.credit##c.incometh i.educat##i.credit
margins educat, at(credit = (0 1))
marginsplot, recastci(rarea)

On another note, I thought that running the following code would give a better visualisation of the interactions between income*credit and educate*credit. However, the difference is that it is the predictive margins of credit card adoption and not income/education. Q3) Am I correct in saying that the following code will not illustrate the effect of income or education on cash usage given credit card adoption.Instead, I believe it shows the effect of credit card adoption on cash usage given education/income level.

Code:
reg cashshare age i.credit##c.incometh i.educat##i.credit
margins credit, at(incometh = (0(20)150))
marginsplot, recastci(rarea)

margins credit, at(educat = (1 2 3 4))
marginsplot, recastci(rarea)
Many thanks in advance if you are able to help!