www.crosshyou.info

政府統計の総合窓口のデータや、OECDやUCIやのデータを使って、Rの練習をしています。ときどき、読書記録も載せています。

OECD Trust in government data analysis 5 - Simple linear regression using R - Trust in governance and per capita GDP, log(per capita GDP)

f:id:cross_hyou:20211121080226j:plain

Photo by Annie Spratt on Unsplash 

www.crosshyou.info

This post is following of the above post.

5. Independent variable = capi, by year

f:id:cross_hyou:20211121080746p:plain

Almost year except for 2010 have positive coefficientt. But only 2017 is statisticaly significant.

6. Independent variable = capi by iso.

f:id:cross_hyou:20211121081205p:plain

Some countries has less than 0.05 p.value. CHL and COL have negative sign corfficients with statistically significant. There are only 8 iso-s which have less than 0.05 p.value.

7. Independent variable = l_capi by year.

f:id:cross_hyou:20211121081550p:plain

2007, 2008, 2010 and 2011 have negative sign coefficient but they are not statistically significant. 2017 has only statistically significant.

8. Independent variable = l_capi by iso.

f:id:cross_hyou:20211121082106p:plain

Again, CHL and COL have negative coefficient and there are only 8 iso-s which have less than 0.05 p.value.

Let's make a scatter plot of CHL and COL only and DEU, LTU, KOR, JPN, POL, ISR only.

First, I made indexs for the both.

f:id:cross_hyou:20211121083346p:plain

Let's check those indeces will work fine.

f:id:cross_hyou:20211121083507p:plain

All right. the both indices will do.

Let's make scatter plots.

f:id:cross_hyou:20211121084455p:plain

f:id:cross_hyou:20211121084510p:plain

Good.
Next, do linear regression for negative iso and positive iso.

f:id:cross_hyou:20211121085217p:plain

That' s it. Thank you!

Next post is

 

www.crosshyou.info

 

 

Te read the ast post,

 

www.crosshyou.info