crosshyou

主にクロス表(分割表)分析をしようかなと思いはじめましたが、あまりクロス表の分析はできず。R言語の練習ブログになっています。

Data_Analysis

OECD Discriminatory family code data analysis 8 - Comparing some classification methods.

Photo by Marek Piwnicki on Unsplash www.crosshyou.info This post is following of above post. In this post, I will do some classification methods. Firstly, I make binary variable. I made a binary variable named high, that shows 1 when lpc_g…

OECD Discriminatory family code data analysis 7 - Adding Unemployment data to linear regression and using stargazer() function to compare regression models.

Photo by henry perks on Unsplash www.crosshyou.info This post is following of above post. I load Unenployment rate data. I get this data from OECD we site. Then, I filter only year == 2019. Next, I will merge df4 data frame and unem_2019 d…

OECD Discriminatory family code data analysis 6 - Adding Inflation data to linear regression, still "atwm" and "em" are significant.

Photo by Alexander Schimmeck on Unsplash www.crosshyou.info This post is following of above post.In this post I will add inflation data into previous post's linear regression model.Firstly, I will load inflation data. I got the inflation d…

OECD Discriminatory family code data analysis 4 - Bootstrap method for getting Confidence Interval with R

Photo by Jeremy Santana on Unsplash www.crosshyou.info This post is following of above post.In the previous post, I get Confidence Interval using standard error. In this post, I will get Confidence Interval using Bootstrap method. Bootstra…

OECD Discriminatory family code data analysis 3 - average and confidence intervals using R

Photo by Alexander Schimmeck on Unsplash www.crosshyou.info This is following of above post.In this post, I will calculating confidence intervals for "atwm"; Attitudes Towards Working Mothers and "em",; Early Marriage. Let's begin. We can …

OECD Discriminatory family code data analysis 2 - Making a histogram, a boxplot and an ECDF plot with R

Photo by Kentaro Toma on Unsplash www.crosshyou.info This post is following of the above post.In this post, I will make histograms, boxplots and ECDF plots with R. Before making those plots, I made some changes to the dataframe. I changed …

OECD Discriminatory family code data analysis 1 - load CSV file with read_csv() fundtion and display dataframe summary with summary() function in R.

Photo by Redd on Unsplash I will analyize ODEC Discriminatory family code. Inequality - Discriminatory family code - OECD Data I downloaded CSV file likde below from aboce web site. Let's analyze with R. Before load the CSV file, I load ti…

OECD Material productivity data analysis 6 - Using R to analyze panel data with plm package

Photo by JD Rincs on Unsplash www.crosshyou.info This post follows above post.In this post, I will do panel data regression analysis with R using plm package. First, le's see which year has many observations. 2010, 2011, 2012, 2013 and 201…

OECD Material Productivity data analysis 5 - Using R for testing AR(1) serial correlation.

Photo by Ken Cheung on Unsplash www.crosshyou.info This post follows above post. I add trend variable to static model. Althogh adding trend, GDP is still significant. So, I make three model, static model, finite distributed lag model and s…

OECD Material productivity data analysis 4 - Using R for Time-Series Data analysis, static model and finite distributed lag model

Photo by mostafa meraji on Unsplash www.crosshyou.info This post follow abovr post. In the previous post, I did cross section data analysis. In this post, I do time-series data analysis. First, let's check how many LOCATION have most data.…

OECD Material productivity data analysis 3 - Using R for multiple linear regression. OLS(ordinary least squares) and WLS(weighted least squares)

Photo by Wolfgang Hasselmann on Unsplash www.crosshyou.info This post is following of above post. From the previous post, NONNRGMAT has correlated to r_capi: squared rooted per capita gdp. Let's do regression analysys using R. p-value for …

OECD Material productivity data analysis 2 - Using R ggplot2 for making some graphs.

Photo by Mateusz Klein on Unsplash www.crosshyou.info This post is following of the above post.Let's make some graphs to get big picuture of the data. Fisrstly, I make histograms for each variables. Let's start with NONNRGMAT TOTMAT before…

OECD Material productivity data analysis 1 - Using R to load CSV file data and reshape dataframe format with pivot_wider.

Photo by Ivana Cajina on Unsplash In this blog, I will analyze OECD Material productivity data. First, I downloaded data from the OECD webiste: Materials - Material productivity - OECD Data OECD (2022), Material productivity (indicator). d…

OECD Purchasing power parities (PPP) data analysis 6 - Time-Series Analysis using R. Static Time Series Model

Photo by Sora Sagano on Unsplash www.crosshyou.info This post is following of the above post. In this post, I will do time-series analysis. I use JPN data only. Firstly, I make JPN only dataframe. Then, let's see statistical summary of df_…

OECD Purchasing power parities (PPP) data analysis 5 - PCA (Principal Component Analysis) using R.

Photo by Aron Visuals on Unsplash www.crosshyou.info This post is following of the above post.In this post, I will do PCA(Principal Component Analysis). I refer below web site.Principal Component Analysis (PCA) 101, using R | by Peter Nist…

OECD Purchasing power parities (PPP) data analysis 4 - Hierarchical Clustering and K-means Clustering using R.

Photo by Mylon Ollila on Unsplash www.crosshyou.info This post is following of the above post. In this post, I will do clustering. First, I use hierarchial clustering. I make a matrix for clustering. I use 2018 and 2019 data. Then, I use d…

OECD Purchasing power parities (PPP) data analysis 3 - relationship with GDP data and PPP. Some countries have positive correlation and some have negative.

Photo by Quino Al on Unsplash www.crosshyou.info This post is following of the above post.I have GDP data file like below, which I downloaded OECD web site. I am going to merge this data to previous ppp data. Firstly, I upload this CSV fil…

OECD Purchasing power parities (PPP) data analysis 2 - TUR, MEX and ISL have volatile PPP and LUX, BEL and CAN have stable PPP

Photo by Drew Bae on Unsplash www.crosshyou.info This post is following of the above post. In this post, let's make some graphs. Firstly, let's see year vs. ppp. I use plot() function. We see 2 countries have relatively high ppp than oters…

OECD Purchasing power parities (PPP) data analysis 1 - read CSV file with read_csv() function in R and make a dataframe to analyze.

Photo by Andrew Svk on Unsplash In this post, I will analyze OECD Purchasing power parities (PPP). From the OECD website, I got below CSV file. I analyze those data with R. Firstly, I load tidyvesr package. Let's load the CSV file with rea…

OECD Trust in government data analysis 8 - Trust is government cannot be explained simply by per capita GDP, inflation and long-term unemployment.

Photo by Rob Wicks on Unsplash www.crosshyou.info This post is following of above post. In the previous post I used only JPN data.Let's use whole data in this post.Firstly, I make a multiple linear regression model by year. Dependent varia…

OECD Trust in government data analysis 7 - In Japan, Trust in government and log(per capita GDP) has some relationship.

Photo by Zoltan Tasi on Unsplash www.crosshyou.info This post is following above post. I will add interst rate data and long term unpenployment data. longterm unenployment is "number of unenployee more than 12 months / number of all unenpo…

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

Photo by Annie Spratt on Unsplash www.crosshyou.info This post is following of the above post. 5. Independent variable = capi, by year Almost year except for 2010 have positive coefficientt. But only 2017 is statisticaly significant. 6. In…

OECD Trust in government data analysis 3 - Correlation between Trust in government and GDP, per capita GDP using R.

Photo by Sunil Naik on Unsplash www.crosshyou.info This post is following of the above post. I have another data file like below This is GDP and per capita GDP data.I will merge this data with trust in government data. First, I load this f…

OECD Trust in government data analysis 2 - ANOVA analysis shows Trust in government are different by countries. ITA has the lowest, CAN has the highest.

Photo by SGR on Unsplash www.crosshyou.info This post is following of the above post. In the previous post, I loaded OECD Trust in government data.Let's see overall histogram of the data. I use hist() function. It looks like normal distrib…

OECD Trust in government data analysis 1 - Using R read_csv() function to load CSV file data.

Photo by Taun Stewart on Unsplash I this series of posts, I will analysis OECD data, "Trust in governmet".I got below CSV file from General government - Trust in government - OECD Data I use R to analyze this data. Firstly, I load tidyvers…

OECD Business confidence Index(BCI) data analysis 8 - BCI and GDP Growth are positively correlated.

Photo by J Lee on Unsplash www.crosshyou.info This post is following of above post.In the previous post, I made panel data dataframe.Let's analyze this. Firstly, let's see correlation. g_gdp and g_capi are highly correlated. bci_sd are neg…

OECD Business confidence Index(BCI) data analysis 7 - making a panel dataframe using plm packages pdata.frame() function.

Photo by Samuel Mwamburi on Unsplash www.crosshyou.info This post is following of above post. I have GDP and per capita GDP data file like below. Let's use this data too. I load this data with read_csv() function. Then, I will merge gdp_da…

OECD Business confidence Index(BCI) data analysis 6 - There is no monthly/quarterly seasonality for BCI.

Photo by Juliane Liebermann on Unsplash www.crosshyou.info This post is following of above post. Now, let's see df dataframe object again. df have "time" variable as Date class. I will make year and month from time.I need lubridate package…

OECD Business confidence Index(BCI) data analysis 5 - Time-Series Regression using R, Finite Distributed Lag(FDL) Model

Photo by JuniperPhoton on Unsplash www.crosshyou.info This post is follwong of abovr post.In this post, I will examone Finite Distributed Lag(FDL) Model. Firstly, I make a ts object from df_avg objrect. Then, I use dynlm() function to make…

OECD Business confidence Index(BCI) data analysis 4 - Time-Series Regression using R - static model

Photo by Elena Louca on Unsplash www.crosshyou.info This post is following of above post. Let's do time-series regression.Firstly, let's make a static time series model In time-series regression, we have to care about serial correlation of…