crosshyou

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

Data_Analysis

OECD Non-Financial Corporations Debt to Surplus Ratio Analysis 3 - Calculating Confidence Interval in R, Parametric and Monte Carlo.

UnsplashのHeather Wildeが撮影した写真 www.crosshyou.info This post is following of the above post. In this post, I will show some statistics of our data. Before investigation, I make data frame to wide format with pivot_wider() function. W…

OECD Non-Financial Corporations Debt to Surplus Ratio Analysis 2 - making various type plots with ggplot() + geom_~~~ using R.

UnsplashのJ Cruikshankが撮影した写真 www.crosshyou.info This post is following of the above post. In the previous post, I load CSV file data into R. Then, let's make some basic graphs using ggplot2 package. Scatter plot ggplot() + geom_poi…

OECD Non-Financial Corporations Debt to Surplus Ratio Analysis 1 - Load CSV file data using R

UnsplashのJeremy Thomasが撮影した写真 In this post, I will use R for analysis about OECD Non-Financial Corporations Debt to Surplus Ratio. This ratio is debt outstanding / annual flow if gross operating surplus. So, the higher the ratio, t…

OECD Nutrient balance data analysis 8 - F-Test and Heteroskedasticity-Robust Inference in R

Photo by S. Tsuchiya on Unsplash www.crosshyou.info This post is following above post. In the previous post, I did multiple regression, s_ni_kg ~ s_po_kg + s_ni_to. Let's add 'time' variables. All time variables are not statistically signi…

OECD Nutrient balance data analysis 7 - Simple Regression and Multiple Regression using R

Photo by Harry Gillen on Unsplash www.crosshyou.info This post is following of the above post. In the previous post, I made scaled variables in df4, let's see correlation matrix of those variables. The most highly correlated variable pair …

OECD Nutrient balance data analysis 6 - making a panel data using R

Photo by Philip Myrtorp on Unsplash www.crosshyou.info This post is following of above post. Since I made several objects, let me confirm what objects there is. ls() function shows current object list. So far, I have df_raw, df1, df2 and d…

OECD Nutrient balance data analysis 5 - Hierarchical Clustering using R

Photo by Erda Estremera on Unsplash www.crosshyou.info This post is following of above post. Let's make two scatter plots and display them in a panel. Firstly, I load gridExtra package. Then, I make two objects, each object is for a scatte…

OECD Nutrient balance data analysis 4 - PCA(Principal Component Analysis) using R

Photo by Ash from Modern Afflatus on Unsplash www.crosshyou.info This post is following of above post. In the above post, I made a dataframe which has basic statistics data for each locations. Let's look into it further, Firstly, let's see…

OECD Nutrient balance data analysis 3 - Line charts using R

Photo by Stephen Leonardi on Unsplash www.crosshyou.info This post is following of above post. I will make line charts using R ggplot2 package. Let's start with ni_kg(NITROGEN measured by KG_HA) Some locations have declining trend, some ha…

OECD Nutrient balance data analysis 2 - Histogram using R

Photo by Leonardo Yip on Unsplash www.crosshyou.info This post is following of above post. In this post, I will do data visualization. Firstly, let's make a histograms. The previous post shows there are 4 kind of observations, NITOROGEN me…

OECD Nutrient balance data analysis 1 - load data into R

Photo by ross tek on Unsplash In this post, I will upload OECD Nutrient balance data in to R.From OECD web iste, I downloaded data csv file like below. Let's analyze this data in R! Firstly I load "tidyverse" package, this is the great pac…

OECD Young self-employed data analysis 6 - panel data analysis using R - first differenced estimator using plm package

Photo by Daniel Olah on Unsplash www.crosshyou.info This post is following of above post. In this post, I will use First Differenced Estimator to estimate capi10K effect for men. The background model is below men = beta_0 + beta_1 * capi10…

OECD Young self-employed data analysis 5 - panel data analysis using R - basic pooling cross section regression

Photo by Colin Watts on Unsplash www.crosshyou.info This post is following of above post. In the above post, I made panel data set. Let's analyze with the panel data. Firstly, I male year dummy variable. y15 is 1 when TIME is 2015 and 0 wh…

OECD Young self-employed data analysis 4 - data visualization again and combining GDP data.

Photo by Fatih Yürür on Unsplash www.crosshyou.info This post is following of above post. In the previous post, I made a new data frame, df_new, which has mem variable and women variable. Let's visualize those data. Firstly, men data by LO…

OECD Young self-employed data analysis 3 - Comparing men and women young data. men has higher ration than women.

Photo by RoonZ nl on Unsplash www.crosshyou.info This post is following of above post. In this post, let's compare men self-employed and women self-employed.Firstly, I make two vectors, "men" and "women" Let's see both summary statistics. …

OECD Young self-employed data analysis 2 - data visualization with ggplot2 package, geom_point(), geom_line(), geom_boxplot and geom_histogram() and geom_bar().

Photo by CHUTTERSNAP on Unsplash www.crosshyou.info This posit is following of above post.Let's see data on some graphs. I use ggplot2 package which is included in tidyverse package. gerom_point() function makes scatter plot. I see men has…

OECD Young self-employed data analysis 1 - Read CSV file using R

Photo by Slawek K on Unsplash In this post, I will analyze OECD Young self-employed data. This is the sare of self-employed aged 20-29 among all employed worksers aged 20-29 in this group. The CSV file which I download from OECD web site i…

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…