0

I want to know if it's possible to make a descriptive table for panel data using Stargazer. I tried myself but haven't managed to replicate a good descriptive table for the panel data. Does anyone know how to solve this?

enter image description here

Phil
  • 7,287
  • 3
  • 36
  • 66
  • 1
    Hello @Jon, could you please provide more rows of your dataset? For make a little reproducible example in R you can follow this tips: https://stackoverflow.com/questions/49994249/example-of-using-dput – LucaCoding Mar 16 '22 at 09:49
  • In summary, you can go to R an write the following easy code "{dput(table_name)}". The a little reproducible example of your dataset will be generate, you can copy it in the question. – LucaCoding Mar 16 '22 at 10:42
  • 1
    The usual caveat: you shouldn’t use ‘stargazer’, because [‘stargazer’ is an utterly atrocious package](https://www.reddit.com/r/rstats/comments/6o9v9h/whats_your_favorite_relatively_obscure_r_package/dkgw9q1/). Use ‘[modelsummary](https://cran.r-project.org/package=modelsummary)’ or ‘[texreg](https://cran.r-project.org/package=texreg)’ instead, or *literally anything else*. – Konrad Rudolph Mar 16 '22 at 16:27

1 Answers1

0

panelr provides a paneldata object that has a decent summary:

library("panelr")
library("plm")
data("Produc", package="plm")

Produc <- panel_data(Produc, id = state, wave = year)
summary(Produc, pcap)

── Variable type: numeric ─────────────────────────────────────────────────────────────────────────────────────────────────
   skim_variable year n_missing complete_rate   mean     sd    p0   p25    p50    p75    p100 hist 
 1 pcap          1970         0             1 20859. 24593. 2627. 6383. 14881. 21930. 128545. ▇▁▁▁▁
 2 pcap          1971         0             1 21677. 25430. 2756. 6548. 15406. 23087. 132263. ▇▁▁▁▁
 3 pcap          1972         0             1 22425. 26171. 2895. 6640. 15815. 24114. 134452. ▇▁▁▁▁
 4 pcap          1973         0             1 23106. 26887. 2967. 6778. 16206. 24855. 135988. ▇▁▁▁▁
 5 pcap          1974         0             1 23704. 27477. 3025. 6896. 16461. 25385. 136827. ▇▁▁▁▁
 6 pcap          1975         0             1 24324. 28100. 3083. 7041. 16865. 25827. 138487. ▇▁▁▁▁
 7 pcap          1976         0             1 24852. 28533. 3076. 7182. 17250. 26003. 139514. ▇▁▁▁▁
 8 pcap          1977         0             1 25278. 28698. 3055. 7342. 17639. 26449. 139910. ▇▁▁▁▁
 9 pcap          1978         0             1 25573. 28700. 3019. 7484. 17944. 27049. 139409. ▇▁▁▁▁
10 pcap          1979         0             1 25939. 28833. 3020. 7646. 18105. 27692. 140217. ▇▁▁▁▁
11 pcap          1980         0             1 26251. 28824. 3032. 7819. 18157. 28062. 139777. ▇▁▁▁▁
12 pcap          1981         0             1 26558. 28837. 3017. 8075. 18161. 28525. 139662. ▇▁▁▁▁
13 pcap          1982         0             1 26740. 28796. 2983. 8305. 18086. 28656. 139232. ▇▁▁▁▁
14 pcap          1983         0             1 26853. 28762. 2951. 8590. 18174. 29023. 138536. ▇▁▁▁▁
15 pcap          1984         0             1 26957. 28744. 2928. 9066. 18498. 29336. 138102. ▇▁▁▁▁
16 pcap          1985         0             1 27134. 28827. 2925. 9314. 18871. 29606. 138171. ▇▂▁▁▁
17 pcap          1986         0             1 27393. 29016. 2936. 9461. 19306. 29882. 139043. ▇▂▁▁▁

Can you tell what kind of descriptives you are looking for?

Marco
  • 2,368
  • 6
  • 22
  • 48