0

I'm looking for a prettier output from estimations using the library micEconAids. stargazer does not seem to work, unless I estimate the equations "by hand" using lm or other regression package for seemingly unrelated equations. Some of the methods implemented by the package I might be able to replicate on my own, but not all of them.

So, are there any alternatives that could give me a better output besides the regression output from the summary?

Below I've pasted some coding to exemplify the problem:

rm(list=ls())

library(micEconAids)

data(Blanciforti86)

priceNames = c( "pFood1", "pFood2", "pFood3", "pFood4" )
shareNames = c( "wFood1", "wFood2", "wFood3", "wFood4" )

laaidsResult1 = aidsEst( priceNames, shareNames, "xFood", data = Blanciforti86,
                         priceIndex = "S"  )

laaidsResult2 = aidsEst( priceNames, shareNames, "xFood", data = Blanciforti86,
                        priceIndex = "P"  )

laaidsResult3 = aidsEst( priceNames, shareNames, "xFood", data = Blanciforti86,
                        priceIndex = "SL"  )

summary(laaidsResult1)
summary(laaidsResult2)
summary(laaidsResult3)

#Stargazer does not work with `micEconAids`:

stargazer::stargazer(laaidsResult1, laaidsResult2, laaidsResult3)

#What are the alternatives for showing a prettier output?

#######################################################################################################################

#In the previous examples, an AIDS model was regressed.
#Below there is an example of how the models could/should look like -- in a three equation setup --
#using `lm` function, which works with `stargazer`.


reg1 = lm(Blanciforti86$wFood1 ~ Blanciforti86$pFood1)
reg2 = lm(Blanciforti86$wFood2 ~ Blanciforti86$pFood2)
reg3 = lm(Blanciforti86$wFood3 ~ Blanciforti86$pFood3)

stargazer::stargazer(reg1,reg2,reg3, type="text")
John Doe
  • 212
  • 1
  • 9
  • 28

1 Answers1

1

The output from aidsEst has a ton of information in a list structure. If there's a specific output set that you want to examine, you can pull it out and use broom::tidy() to view in a nicer format.

For example, aidsEst() contains a $coef object, which in turn has a $stat data frame.
Using tidy():

tidy(laaidsResult1$coef$stat)

   .rownames     Estimate  Std..Error    t.value     Pr...t..
1    alpha 1 -0.247298293 0.070079963 -3.5288017 6.798727e-04
2    alpha 2  0.109249097 0.057874966  1.8876745 6.252270e-02
3    alpha 3  0.268238436 0.034413442  7.7945832 1.560840e-11
4    alpha 4  0.869810761 0.090578360  9.6028539 3.635728e-15
5     beta 1  0.323989176 0.041041424  7.8941991 9.873279e-12
6     beta 2  0.055863164 0.033599356  1.6626261 1.001146e-01
7     beta 3 -0.078626097 0.020025657 -3.9262681 1.760820e-04
8     beta 4 -0.301226244 0.052987085 -5.6848993 1.848756e-07
9  gamma 1 1  0.104150200 0.020804442  5.0061521 3.018569e-06
10 gamma 1 2 -0.139880152 0.015303438 -9.1404395 3.094504e-14

Use str(laaidsResult1) to poke around in the aidsEst output for the specific things you're looking for.

andrew_reece
  • 20,390
  • 3
  • 33
  • 58