Title: | Data Manipulation |
---|---|
Description: | Is designed to make easier printing summary statistics (for continues and factor level) tables in Latex, and plotting by factor. |
Authors: | Seyma Kalay |
Maintainer: | Seyma Kalay <[email protected]> |
License: | GPL-3 |
Version: | 1.2.0 |
Built: | 2025-02-25 04:31:16 UTC |
Source: | https://github.com/seymakalay/pepe |
Creating Dataset for Plot.by.Factr
df4.Plot.by.Factr(var, df)
df4.Plot.by.Factr(var, df)
var |
Vector of factor variables. |
df |
Dataset. |
The output from df4.Plot.by.Factr
df <- sample_data[c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ", "rural", "sex", "havejob", "political.afl") df4.Plot.by.Factr(var,df)
df <- sample_data[c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ", "rural", "sex", "havejob", "political.afl") df4.Plot.by.Factr(var,df)
Plot by Factor
Plot.by.Factr(XXX, name.levels)
Plot.by.Factr(XXX, name.levels)
XXX |
object to be plotted. |
name.levels |
name object. |
The output from Plot.by.Factr
.
df <- sample_data[c("Formal","Informal","L.Both", "No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ","rural") name.levels <- c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries") XXX <- df4.Plot.by.Factr(var,df)$Summ.Stats.long Plot.by.Factr(XXX, name.levels)
df <- sample_data[c("Formal","Informal","L.Both", "No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ","rural") name.levels <- c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries") XXX <- df4.Plot.by.Factr(var,df)$Summ.Stats.long Plot.by.Factr(XXX, name.levels)
Pivot Table by Factor
Pvot.by.Factr(df)
Pvot.by.Factr(df)
df |
The data frame of factor variables. |
The output from Pvot.by.Factr
.
df <- sample_data[c("multi.level", "Formal","L.Both","No.Loan", "region", "sex", "educ", "political.afl", "married", "havejob", "rural", "fin.knowldge", "fin.intermdiaries")] Pvot.by.Factr(df)
df <- sample_data[c("multi.level", "Formal","L.Both","No.Loan", "region", "sex", "educ", "political.afl", "married", "havejob", "rural", "fin.knowldge", "fin.intermdiaries")] Pvot.by.Factr(df)
Sample data for analysis.
A dataset containing information of access to credit.
sample_data
sample_data
A data_frame
with 53940 rows and 10 variables:
hhid, household id number
Cluster.No, cluster no
region, 3 factor level, west, east, and center
No.Loan, if the household has no loan
Formal, if the household has formal loan
Both, if the household has both loan
Informal, if the household has informal loan
sex, if the household has male
Income of the household
Loan.Type, 4 factor level type of the loan
multi.level, 2 factor level if the household has access to loan or not
...
Summary Statistics by Factor
Stats.by.Factr(var, df)
Stats.by.Factr(var, df)
var |
The vector to set summary statistics. |
df |
The name of the Data set. |
The output from Stats.by.Factr
.
df <- sample_data[c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ") Stats.by.Factr(var, df)
df <- sample_data[c("Formal","Informal","L.Both","No.Loan", "sex","educ","political.afl","married", "havejob","rural","age","Income","Networth","Liquid.Assets", "NW.HE","fin.knowldge","fin.intermdiaries")] CN = colnames(df) var <- c("educ") Stats.by.Factr(var, df)