Reading and describing data

knitr::opts_chunk$set(echo = TRUE)
library(readr)
MBA <- read_csv("C:/Users/Internship/company_master_data_upto_Mar_2015_Uttar_Pradesh.csv")
## Parsed with column specification:
## cols(
##   CORPORATE_IDENTIFICATION_NUMBER = col_character(),
##   DATE_OF_REGISTRATION = col_character(),
##   COMPANY_NAME = col_character(),
##   COMPANY_STATUS = col_character(),
##   COMPANY_CLASS = col_character(),
##   COMPANY_CATEGORY = col_character(),
##   AUTHORIZED_CAPITAL = col_number(),
##   PAIDUP_CAPITAL = col_number(),
##   REGISTERED_STATE = col_character(),
##   REGISTRAR_OF_COMPANIES = col_character(),
##   PRINCIPAL_BUSINESS_ACTIVITY = col_character(),
##   REGISTERED_OFFICE_ADDRESS = col_character(),
##   SUB_CATEGORY = col_character()
## )
library(psych)
dim(MBA)
## [1] 65165    13

Descriptive Statistics

Q2: Create a descriptive statistics (min, max, median etc) of each variable

describe(MBA)[,c(1:5,8:10)]
## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion

## Warning in describe(MBA): NAs introduced by coercion
## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to min; returning
## Inf
## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf

## Warning in FUN(newX[, i], ...): no non-missing arguments to max; returning
## -Inf
##                                  vars     n     mean         sd median
## CORPORATE_IDENTIFICATION_NUMBER*    1 65165      NaN         NA     NA
## DATE_OF_REGISTRATION*               2 65165      NaN         NA     NA
## COMPANY_NAME*                       3 65165      NaN         NA     NA
## COMPANY_STATUS*                     4 65165      NaN         NA     NA
## COMPANY_CLASS*                      5 65165      NaN         NA     NA
## COMPANY_CATEGORY*                   6 65165      NaN         NA     NA
## AUTHORIZED_CAPITAL                  7 65080 34300681 2654993776 500000
## PAIDUP_CAPITAL                      8 61432 18468122 1688743992 100000
## REGISTERED_STATE*                   9 65165      NaN         NA     NA
## REGISTRAR_OF_COMPANIES*            10 65165      NaN         NA     NA
## PRINCIPAL_BUSINESS_ACTIVITY*       11 63851      NaN         NA     NA
## REGISTERED_OFFICE_ADDRESS*         12 65165      NaN         NA     NA
## SUB_CATEGORY*                      13 65165      101         NA    101
##                                    min          max        range
## CORPORATE_IDENTIFICATION_NUMBER*   Inf         -Inf         -Inf
## DATE_OF_REGISTRATION*              Inf         -Inf         -Inf
## COMPANY_NAME*                      Inf         -Inf         -Inf
## COMPANY_STATUS*                    Inf         -Inf         -Inf
## COMPANY_CLASS*                     Inf         -Inf         -Inf
## COMPANY_CATEGORY*                  Inf         -Inf         -Inf
## AUTHORIZED_CAPITAL               500.0 600000000000 599999999500
## PAIDUP_CAPITAL                     2.7 397508184000 397508183997
## REGISTERED_STATE*                  Inf         -Inf         -Inf
## REGISTRAR_OF_COMPANIES*            Inf         -Inf         -Inf
## PRINCIPAL_BUSINESS_ACTIVITY*       Inf         -Inf         -Inf
## REGISTERED_OFFICE_ADDRESS*         Inf         -Inf         -Inf
## SUB_CATEGORY*                    101.0          101            0

Variable Analysis

One way contengency tables Q3: Create one-way contingency tables for the categorical variables

mytable1 <- with(MBA, table(COMPANY_CLASS))
mytable1
## COMPANY_CLASS
## One Person Company            Private             Public 
##                229              57708               7228
mytable2 <- with(MBA, table(COMPANY_STATUS))
mytable2
## COMPANY_STATUS
##                                           ACTIVE 
##                                            48079 
##                               ACTIVE IN PROGRESS 
##                                                5 
##                                      AMALGAMATED 
##                                              197 
##                                 CONVERTED TO LLP 
##                                               24 
##                   CONVERTED TO LLP AND DISSOLVED 
##                                               66 
##                                        DISSOLVED 
##                                                5 
##                                          DORMANT 
##                                             4327 
## Dormant under section 455 of Companies Act, 2013 
##                                                7 
##                                       LIQUIDATED 
##                                               16 
##                                       STRIKE OFF 
##                                            11107 
##                                UNDER LIQUIDATION 
##                                              214 
##                    UNDER PROCESS OF STRIKING OFF 
##                                             1118
mytable3<- with(MBA, table(COMPANY_CLASS))
mytable3
## COMPANY_CLASS
## One Person Company            Private             Public 
##                229              57708               7228
mytable4 <- with(MBA, table(SUB_CATEGORY))
mytable4
## SUB_CATEGORY
##                                                                        # 8 
##                                                                          1 
##                                                                        101 
##                                                                          1 
##                                                    1127 Ministerial Colony 
##                                                                          1 
##                                                                  1st FLOOR 
##                                                                          1 
##                                                240/11 MURTAJA HUSSAIN ROAD 
##                                                                          1 
##                                                240/11 MURTAZA HUSSAIN ROAD 
##                                                                          1 
##                                                                  2ND FLOOR 
##                                                                          1 
##                                                          57/2 Sanjay Place 
##                                                                          1 
##                                ALIGANJ LUCKNOW Uttar Pradesh INDIA 226024" 
##                                                                          1 
##                                                                       B-15 
##                                                                          2 
##                                                         B-15 FAIZABAD ROAD 
##                                                                          1 
##                                              BURJA ROAD NEAR LALITA ASHRAM 
##                                                                          1 
##                                                                        C-7 
##                                                                          4 
##                                                                CIVIL LINES 
##                                                                          1 
##                                           Company licensed under Section25 
##                                                                         97 
##                                                                      F-482 
##                                                                          1 
##                                          Guarantee and association Company 
##                                                                         14 
##                                                     HOLYFLAME ACADEMY ROAD 
##                                                                          1 
##                                              Indian Non-Government Company 
##                                                                      64549 
##         JAR PAHAD C.P. MISSION COMPOUND JHANSI Uttar Pradesh INDIA 284001" 
##                                                                          1 
##                                                                 K. No. 209 
##                                                                          2 
##              LAXMI NAGAR KRISHNA NAGAR MATHURA Uttar Pradesh INDIA 281001" 
##                                                                          1 
##                 LDA Colony Kanpur Road Lucknow Uttar Pradesh INDIA 226005" 
##                                                                          1 
##                                                                  MAHANAGAR 
##                                                                          1 
##                                                                     Others 
##                                                                        281 
##                                                                    Plot #7 
##                                                                          1 
##                                                   State Government Company 
##                                                                        122 
## STREET NO. 4 ANAND VIHAR LOWER BAZAR MODINAGAR Uttar Pradesh INDIA 201204" 
##                                                                          1 
##                                              Subsidiary of Foreign Company 
##                                                                         53 
##                                                   Union Government Company 
##                                                                         21

Two way contengency tables

Q4: Create two-way contingency tables for the categorical variables

mytable5 <- xtabs(~ PRINCIPAL_BUSINESS_ACTIVITY+COMPANY_STATUS, data=MBA)
mytable5
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       ACTIVE
##   Agriculture and Allied Activities                                                                 1303
##   Business Services                                                                                12617
##   Community, personal & Social Services                                                             3732
##   Construction                                                                                      6876
##   Electricity, Gas & Water companies                                                                 276
##   Finance                                                                                           1700
##   Insurance                                                                                           89
##   Manufacturing (Food stuffs)                                                                       2318
##   Manufacturing (Leather & products thereof)                                                         357
##   Manufacturing (Machinery & Equipments)                                                            1429
##   Manufacturing (Metals & Chemicals, and products thereof)                                          3527
##   Manufacturing (Others)                                                                             347
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)    772
##   Manufacturing (Textiles)                                                                           949
##   Manufacturing (Wood Products)                                                                      106
##   Mining & Quarrying                                                                                 263
##   Real Estate and Renting                                                                           6456
##   Trading                                                                                           3794
##   Transport, storage and Communications                                                              938
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       ACTIVE IN PROGRESS
##   Agriculture and Allied Activities                                                                                0
##   Business Services                                                                                                0
##   Community, personal & Social Services                                                                            0
##   Construction                                                                                                     1
##   Electricity, Gas & Water companies                                                                               0
##   Finance                                                                                                          1
##   Insurance                                                                                                        0
##   Manufacturing (Food stuffs)                                                                                      0
##   Manufacturing (Leather & products thereof)                                                                       0
##   Manufacturing (Machinery & Equipments)                                                                           0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                         2
##   Manufacturing (Others)                                                                                           0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                  1
##   Manufacturing (Textiles)                                                                                         0
##   Manufacturing (Wood Products)                                                                                    0
##   Mining & Quarrying                                                                                               0
##   Real Estate and Renting                                                                                          0
##   Trading                                                                                                          0
##   Transport, storage and Communications                                                                            0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       AMALGAMATED
##   Agriculture and Allied Activities                                                                         1
##   Business Services                                                                                         7
##   Community, personal & Social Services                                                                     3
##   Construction                                                                                             13
##   Electricity, Gas & Water companies                                                                        1
##   Finance                                                                                                  36
##   Insurance                                                                                                 0
##   Manufacturing (Food stuffs)                                                                              22
##   Manufacturing (Leather & products thereof)                                                                5
##   Manufacturing (Machinery & Equipments)                                                                    8
##   Manufacturing (Metals & Chemicals, and products thereof)                                                 24
##   Manufacturing (Others)                                                                                    0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)           8
##   Manufacturing (Textiles)                                                                                 13
##   Manufacturing (Wood Products)                                                                             1
##   Mining & Quarrying                                                                                        0
##   Real Estate and Renting                                                                                   3
##   Trading                                                                                                  20
##   Transport, storage and Communications                                                                     0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       CONVERTED TO LLP
##   Agriculture and Allied Activities                                                                              0
##   Business Services                                                                                              0
##   Community, personal & Social Services                                                                          0
##   Construction                                                                                                   4
##   Electricity, Gas & Water companies                                                                             0
##   Finance                                                                                                        2
##   Insurance                                                                                                      0
##   Manufacturing (Food stuffs)                                                                                    1
##   Manufacturing (Leather & products thereof)                                                                     1
##   Manufacturing (Machinery & Equipments)                                                                         0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                       2
##   Manufacturing (Others)                                                                                         0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                1
##   Manufacturing (Textiles)                                                                                       0
##   Manufacturing (Wood Products)                                                                                  0
##   Mining & Quarrying                                                                                             0
##   Real Estate and Renting                                                                                       11
##   Trading                                                                                                        1
##   Transport, storage and Communications                                                                          1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       CONVERTED TO LLP AND DISSOLVED
##   Agriculture and Allied Activities                                                                                            0
##   Business Services                                                                                                            4
##   Community, personal & Social Services                                                                                        4
##   Construction                                                                                                                20
##   Electricity, Gas & Water companies                                                                                           1
##   Finance                                                                                                                      3
##   Insurance                                                                                                                    0
##   Manufacturing (Food stuffs)                                                                                                  2
##   Manufacturing (Leather & products thereof)                                                                                   2
##   Manufacturing (Machinery & Equipments)                                                                                       1
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                     3
##   Manufacturing (Others)                                                                                                       0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                              2
##   Manufacturing (Textiles)                                                                                                     0
##   Manufacturing (Wood Products)                                                                                                0
##   Mining & Quarrying                                                                                                           0
##   Real Estate and Renting                                                                                                     17
##   Trading                                                                                                                      7
##   Transport, storage and Communications                                                                                        0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       DISSOLVED
##   Agriculture and Allied Activities                                                                       1
##   Business Services                                                                                       1
##   Community, personal & Social Services                                                                   0
##   Construction                                                                                            0
##   Electricity, Gas & Water companies                                                                      0
##   Finance                                                                                                 0
##   Insurance                                                                                               0
##   Manufacturing (Food stuffs)                                                                             0
##   Manufacturing (Leather & products thereof)                                                              0
##   Manufacturing (Machinery & Equipments)                                                                  0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                2
##   Manufacturing (Others)                                                                                  0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)         0
##   Manufacturing (Textiles)                                                                                0
##   Manufacturing (Wood Products)                                                                           0
##   Mining & Quarrying                                                                                      0
##   Real Estate and Renting                                                                                 0
##   Trading                                                                                                 0
##   Transport, storage and Communications                                                                   1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       DORMANT
##   Agriculture and Allied Activities                                                                   244
##   Business Services                                                                                   197
##   Community, personal & Social Services                                                               103
##   Construction                                                                                        117
##   Electricity, Gas & Water companies                                                                    8
##   Finance                                                                                            2054
##   Insurance                                                                                             1
##   Manufacturing (Food stuffs)                                                                         230
##   Manufacturing (Leather & products thereof)                                                           49
##   Manufacturing (Machinery & Equipments)                                                              162
##   Manufacturing (Metals & Chemicals, and products thereof)                                            513
##   Manufacturing (Others)                                                                               15
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)      84
##   Manufacturing (Textiles)                                                                            105
##   Manufacturing (Wood Products)                                                                        21
##   Mining & Quarrying                                                                                   19
##   Real Estate and Renting                                                                              17
##   Trading                                                                                             259
##   Transport, storage and Communications                                                                34
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       Dormant under section 455 of Companies Act, 2013
##   Agriculture and Allied Activities                                                                                                              0
##   Business Services                                                                                                                              2
##   Community, personal & Social Services                                                                                                          0
##   Construction                                                                                                                                   0
##   Electricity, Gas & Water companies                                                                                                             0
##   Finance                                                                                                                                        0
##   Insurance                                                                                                                                      0
##   Manufacturing (Food stuffs)                                                                                                                    1
##   Manufacturing (Leather & products thereof)                                                                                                     0
##   Manufacturing (Machinery & Equipments)                                                                                                         1
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                                       1
##   Manufacturing (Others)                                                                                                                         1
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                                                0
##   Manufacturing (Textiles)                                                                                                                       0
##   Manufacturing (Wood Products)                                                                                                                  0
##   Mining & Quarrying                                                                                                                             0
##   Real Estate and Renting                                                                                                                        0
##   Trading                                                                                                                                        1
##   Transport, storage and Communications                                                                                                          0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       LIQUIDATED
##   Agriculture and Allied Activities                                                                        0
##   Business Services                                                                                        0
##   Community, personal & Social Services                                                                    1
##   Construction                                                                                             0
##   Electricity, Gas & Water companies                                                                       0
##   Finance                                                                                                  2
##   Insurance                                                                                                0
##   Manufacturing (Food stuffs)                                                                              1
##   Manufacturing (Leather & products thereof)                                                               1
##   Manufacturing (Machinery & Equipments)                                                                   2
##   Manufacturing (Metals & Chemicals, and products thereof)                                                 0
##   Manufacturing (Others)                                                                                   0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)          1
##   Manufacturing (Textiles)                                                                                 1
##   Manufacturing (Wood Products)                                                                            0
##   Mining & Quarrying                                                                                       0
##   Real Estate and Renting                                                                                  0
##   Trading                                                                                                  1
##   Transport, storage and Communications                                                                    0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       STRIKE OFF
##   Agriculture and Allied Activities                                                                      549
##   Business Services                                                                                     1002
##   Community, personal & Social Services                                                                  414
##   Construction                                                                                           667
##   Electricity, Gas & Water companies                                                                      55
##   Finance                                                                                                942
##   Insurance                                                                                               11
##   Manufacturing (Food stuffs)                                                                            929
##   Manufacturing (Leather & products thereof)                                                             196
##   Manufacturing (Machinery & Equipments)                                                                 705
##   Manufacturing (Metals & Chemicals, and products thereof)                                              2056
##   Manufacturing (Others)                                                                                 103
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)        406
##   Manufacturing (Textiles)                                                                               478
##   Manufacturing (Wood Products)                                                                           95
##   Mining & Quarrying                                                                                     107
##   Real Estate and Renting                                                                                142
##   Trading                                                                                               1206
##   Transport, storage and Communications                                                                  151
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       UNDER LIQUIDATION
##   Agriculture and Allied Activities                                                                               8
##   Business Services                                                                                               7
##   Community, personal & Social Services                                                                           4
##   Construction                                                                                                    3
##   Electricity, Gas & Water companies                                                                              1
##   Finance                                                                                                        34
##   Insurance                                                                                                       0
##   Manufacturing (Food stuffs)                                                                                    14
##   Manufacturing (Leather & products thereof)                                                                      3
##   Manufacturing (Machinery & Equipments)                                                                          7
##   Manufacturing (Metals & Chemicals, and products thereof)                                                       60
##   Manufacturing (Others)                                                                                          0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                 7
##   Manufacturing (Textiles)                                                                                       12
##   Manufacturing (Wood Products)                                                                                   0
##   Mining & Quarrying                                                                                              1
##   Real Estate and Renting                                                                                         0
##   Trading                                                                                                        12
##   Transport, storage and Communications                                                                           1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       UNDER PROCESS OF STRIKING OFF
##   Agriculture and Allied Activities                                                                                          24
##   Business Services                                                                                                         210
##   Community, personal & Social Services                                                                                      53
##   Construction                                                                                                               66
##   Electricity, Gas & Water companies                                                                                          3
##   Finance                                                                                                                   329
##   Insurance                                                                                                                   3
##   Manufacturing (Food stuffs)                                                                                                27
##   Manufacturing (Leather & products thereof)                                                                                  5
##   Manufacturing (Machinery & Equipments)                                                                                     28
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                   85
##   Manufacturing (Others)                                                                                                      5
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                            18
##   Manufacturing (Textiles)                                                                                                   21
##   Manufacturing (Wood Products)                                                                                               3
##   Mining & Quarrying                                                                                                          9
##   Real Estate and Renting                                                                                                    53
##   Trading                                                                                                                   132
##   Transport, storage and Communications                                                                                      26
mytable5 <- xtabs(~ COMPANY_STATUS+COMPANY_CLASS, data=MBA)
mytable5
##                                                   COMPANY_CLASS
## COMPANY_STATUS                                     One Person Company
##   ACTIVE                                                          229
##   ACTIVE IN PROGRESS                                                0
##   AMALGAMATED                                                       0
##   CONVERTED TO LLP                                                  0
##   CONVERTED TO LLP AND DISSOLVED                                    0
##   DISSOLVED                                                         0
##   DORMANT                                                           0
##   Dormant under section 455 of Companies Act, 2013                  0
##   LIQUIDATED                                                        0
##   STRIKE OFF                                                        0
##   UNDER LIQUIDATION                                                 0
##   UNDER PROCESS OF STRIKING OFF                                     0
##                                                   COMPANY_CLASS
## COMPANY_STATUS                                     Private Public
##   ACTIVE                                             44540   3310
##   ACTIVE IN PROGRESS                                     4      1
##   AMALGAMATED                                          106     91
##   CONVERTED TO LLP                                      21      3
##   CONVERTED TO LLP AND DISSOLVED                        61      5
##   DISSOLVED                                              3      2
##   DORMANT                                             2587   1740
##   Dormant under section 455 of Companies Act, 2013       6      1
##   LIQUIDATED                                            11      5
##   STRIKE OFF                                          9401   1706
##   UNDER LIQUIDATION                                     71    143
##   UNDER PROCESS OF STRIKING OFF                        897    221
mytable5 <- xtabs(~ SUB_CATEGORY+COMPANY_CLASS, data=MBA)
mytable5
##                                                                             COMPANY_CLASS
## SUB_CATEGORY                                                                 One Person Company
##   # 8                                                                                         0
##   101                                                                                         0
##   1127 Ministerial Colony                                                                     0
##   1st FLOOR                                                                                   0
##   240/11 MURTAJA HUSSAIN ROAD                                                                 0
##   240/11 MURTAZA HUSSAIN ROAD                                                                 0
##   2ND FLOOR                                                                                   0
##   57/2 Sanjay Place                                                                           0
##   ALIGANJ LUCKNOW Uttar Pradesh INDIA 226024"                                                 0
##   B-15                                                                                        0
##   B-15 FAIZABAD ROAD                                                                          0
##   BURJA ROAD NEAR LALITA ASHRAM                                                               0
##   C-7                                                                                         0
##   CIVIL LINES                                                                                 0
##   Company licensed under Section25                                                            0
##   F-482                                                                                       0
##   Guarantee and association Company                                                           0
##   HOLYFLAME ACADEMY ROAD                                                                      0
##   Indian Non-Government Company                                                             229
##   JAR PAHAD C.P. MISSION COMPOUND JHANSI Uttar Pradesh INDIA 284001"                          0
##   K. No. 209                                                                                  0
##   LAXMI NAGAR KRISHNA NAGAR MATHURA Uttar Pradesh INDIA 281001"                               0
##   LDA Colony Kanpur Road Lucknow Uttar Pradesh INDIA 226005"                                  0
##   MAHANAGAR                                                                                   0
##   Others                                                                                      0
##   Plot #7                                                                                     0
##   State Government Company                                                                    0
##   STREET NO. 4 ANAND VIHAR LOWER BAZAR MODINAGAR Uttar Pradesh INDIA 201204"                  0
##   Subsidiary of Foreign Company                                                               0
##   Union Government Company                                                                    0
##                                                                             COMPANY_CLASS
## SUB_CATEGORY                                                                 Private
##   # 8                                                                              1
##   101                                                                              1
##   1127 Ministerial Colony                                                          1
##   1st FLOOR                                                                        1
##   240/11 MURTAJA HUSSAIN ROAD                                                      1
##   240/11 MURTAZA HUSSAIN ROAD                                                      1
##   2ND FLOOR                                                                        1
##   57/2 Sanjay Place                                                                1
##   ALIGANJ LUCKNOW Uttar Pradesh INDIA 226024"                                      1
##   B-15                                                                             2
##   B-15 FAIZABAD ROAD                                                               1
##   BURJA ROAD NEAR LALITA ASHRAM                                                    1
##   C-7                                                                              4
##   CIVIL LINES                                                                      1
##   Company licensed under Section25                                                34
##   F-482                                                                            1
##   Guarantee and association Company                                                9
##   HOLYFLAME ACADEMY ROAD                                                           1
##   Indian Non-Government Company                                                57306
##   JAR PAHAD C.P. MISSION COMPOUND JHANSI Uttar Pradesh INDIA 284001"               0
##   K. No. 209                                                                       2
##   LAXMI NAGAR KRISHNA NAGAR MATHURA Uttar Pradesh INDIA 281001"                    1
##   LDA Colony Kanpur Road Lucknow Uttar Pradesh INDIA 226005"                       1
##   MAHANAGAR                                                                        1
##   Others                                                                         269
##   Plot #7                                                                          1
##   State Government Company                                                         9
##   STREET NO. 4 ANAND VIHAR LOWER BAZAR MODINAGAR Uttar Pradesh INDIA 201204"       1
##   Subsidiary of Foreign Company                                                   50
##   Union Government Company                                                         4
##                                                                             COMPANY_CLASS
## SUB_CATEGORY                                                                 Public
##   # 8                                                                             0
##   101                                                                             0
##   1127 Ministerial Colony                                                         0
##   1st FLOOR                                                                       0
##   240/11 MURTAJA HUSSAIN ROAD                                                     0
##   240/11 MURTAZA HUSSAIN ROAD                                                     0
##   2ND FLOOR                                                                       0
##   57/2 Sanjay Place                                                               0
##   ALIGANJ LUCKNOW Uttar Pradesh INDIA 226024"                                     0
##   B-15                                                                            0
##   B-15 FAIZABAD ROAD                                                              0
##   BURJA ROAD NEAR LALITA ASHRAM                                                   0
##   C-7                                                                             0
##   CIVIL LINES                                                                     0
##   Company licensed under Section25                                               63
##   F-482                                                                           0
##   Guarantee and association Company                                               5
##   HOLYFLAME ACADEMY ROAD                                                          0
##   Indian Non-Government Company                                                7014
##   JAR PAHAD C.P. MISSION COMPOUND JHANSI Uttar Pradesh INDIA 284001"              1
##   K. No. 209                                                                      0
##   LAXMI NAGAR KRISHNA NAGAR MATHURA Uttar Pradesh INDIA 281001"                   0
##   LDA Colony Kanpur Road Lucknow Uttar Pradesh INDIA 226005"                      0
##   MAHANAGAR                                                                       0
##   Others                                                                         12
##   Plot #7                                                                         0
##   State Government Company                                                      113
##   STREET NO. 4 ANAND VIHAR LOWER BAZAR MODINAGAR Uttar Pradesh INDIA 201204"      0
##   Subsidiary of Foreign Company                                                   3
##   Union Government Company                                                       17
mytable5 <- xtabs(~ PRINCIPAL_BUSINESS_ACTIVITY+COMPANY_STATUS, data=MBA)
mytable5
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       ACTIVE
##   Agriculture and Allied Activities                                                                 1303
##   Business Services                                                                                12617
##   Community, personal & Social Services                                                             3732
##   Construction                                                                                      6876
##   Electricity, Gas & Water companies                                                                 276
##   Finance                                                                                           1700
##   Insurance                                                                                           89
##   Manufacturing (Food stuffs)                                                                       2318
##   Manufacturing (Leather & products thereof)                                                         357
##   Manufacturing (Machinery & Equipments)                                                            1429
##   Manufacturing (Metals & Chemicals, and products thereof)                                          3527
##   Manufacturing (Others)                                                                             347
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)    772
##   Manufacturing (Textiles)                                                                           949
##   Manufacturing (Wood Products)                                                                      106
##   Mining & Quarrying                                                                                 263
##   Real Estate and Renting                                                                           6456
##   Trading                                                                                           3794
##   Transport, storage and Communications                                                              938
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       ACTIVE IN PROGRESS
##   Agriculture and Allied Activities                                                                                0
##   Business Services                                                                                                0
##   Community, personal & Social Services                                                                            0
##   Construction                                                                                                     1
##   Electricity, Gas & Water companies                                                                               0
##   Finance                                                                                                          1
##   Insurance                                                                                                        0
##   Manufacturing (Food stuffs)                                                                                      0
##   Manufacturing (Leather & products thereof)                                                                       0
##   Manufacturing (Machinery & Equipments)                                                                           0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                         2
##   Manufacturing (Others)                                                                                           0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                  1
##   Manufacturing (Textiles)                                                                                         0
##   Manufacturing (Wood Products)                                                                                    0
##   Mining & Quarrying                                                                                               0
##   Real Estate and Renting                                                                                          0
##   Trading                                                                                                          0
##   Transport, storage and Communications                                                                            0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       AMALGAMATED
##   Agriculture and Allied Activities                                                                         1
##   Business Services                                                                                         7
##   Community, personal & Social Services                                                                     3
##   Construction                                                                                             13
##   Electricity, Gas & Water companies                                                                        1
##   Finance                                                                                                  36
##   Insurance                                                                                                 0
##   Manufacturing (Food stuffs)                                                                              22
##   Manufacturing (Leather & products thereof)                                                                5
##   Manufacturing (Machinery & Equipments)                                                                    8
##   Manufacturing (Metals & Chemicals, and products thereof)                                                 24
##   Manufacturing (Others)                                                                                    0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)           8
##   Manufacturing (Textiles)                                                                                 13
##   Manufacturing (Wood Products)                                                                             1
##   Mining & Quarrying                                                                                        0
##   Real Estate and Renting                                                                                   3
##   Trading                                                                                                  20
##   Transport, storage and Communications                                                                     0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       CONVERTED TO LLP
##   Agriculture and Allied Activities                                                                              0
##   Business Services                                                                                              0
##   Community, personal & Social Services                                                                          0
##   Construction                                                                                                   4
##   Electricity, Gas & Water companies                                                                             0
##   Finance                                                                                                        2
##   Insurance                                                                                                      0
##   Manufacturing (Food stuffs)                                                                                    1
##   Manufacturing (Leather & products thereof)                                                                     1
##   Manufacturing (Machinery & Equipments)                                                                         0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                       2
##   Manufacturing (Others)                                                                                         0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                1
##   Manufacturing (Textiles)                                                                                       0
##   Manufacturing (Wood Products)                                                                                  0
##   Mining & Quarrying                                                                                             0
##   Real Estate and Renting                                                                                       11
##   Trading                                                                                                        1
##   Transport, storage and Communications                                                                          1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       CONVERTED TO LLP AND DISSOLVED
##   Agriculture and Allied Activities                                                                                            0
##   Business Services                                                                                                            4
##   Community, personal & Social Services                                                                                        4
##   Construction                                                                                                                20
##   Electricity, Gas & Water companies                                                                                           1
##   Finance                                                                                                                      3
##   Insurance                                                                                                                    0
##   Manufacturing (Food stuffs)                                                                                                  2
##   Manufacturing (Leather & products thereof)                                                                                   2
##   Manufacturing (Machinery & Equipments)                                                                                       1
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                     3
##   Manufacturing (Others)                                                                                                       0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                              2
##   Manufacturing (Textiles)                                                                                                     0
##   Manufacturing (Wood Products)                                                                                                0
##   Mining & Quarrying                                                                                                           0
##   Real Estate and Renting                                                                                                     17
##   Trading                                                                                                                      7
##   Transport, storage and Communications                                                                                        0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       DISSOLVED
##   Agriculture and Allied Activities                                                                       1
##   Business Services                                                                                       1
##   Community, personal & Social Services                                                                   0
##   Construction                                                                                            0
##   Electricity, Gas & Water companies                                                                      0
##   Finance                                                                                                 0
##   Insurance                                                                                               0
##   Manufacturing (Food stuffs)                                                                             0
##   Manufacturing (Leather & products thereof)                                                              0
##   Manufacturing (Machinery & Equipments)                                                                  0
##   Manufacturing (Metals & Chemicals, and products thereof)                                                2
##   Manufacturing (Others)                                                                                  0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)         0
##   Manufacturing (Textiles)                                                                                0
##   Manufacturing (Wood Products)                                                                           0
##   Mining & Quarrying                                                                                      0
##   Real Estate and Renting                                                                                 0
##   Trading                                                                                                 0
##   Transport, storage and Communications                                                                   1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       DORMANT
##   Agriculture and Allied Activities                                                                   244
##   Business Services                                                                                   197
##   Community, personal & Social Services                                                               103
##   Construction                                                                                        117
##   Electricity, Gas & Water companies                                                                    8
##   Finance                                                                                            2054
##   Insurance                                                                                             1
##   Manufacturing (Food stuffs)                                                                         230
##   Manufacturing (Leather & products thereof)                                                           49
##   Manufacturing (Machinery & Equipments)                                                              162
##   Manufacturing (Metals & Chemicals, and products thereof)                                            513
##   Manufacturing (Others)                                                                               15
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)      84
##   Manufacturing (Textiles)                                                                            105
##   Manufacturing (Wood Products)                                                                        21
##   Mining & Quarrying                                                                                   19
##   Real Estate and Renting                                                                              17
##   Trading                                                                                             259
##   Transport, storage and Communications                                                                34
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       Dormant under section 455 of Companies Act, 2013
##   Agriculture and Allied Activities                                                                                                              0
##   Business Services                                                                                                                              2
##   Community, personal & Social Services                                                                                                          0
##   Construction                                                                                                                                   0
##   Electricity, Gas & Water companies                                                                                                             0
##   Finance                                                                                                                                        0
##   Insurance                                                                                                                                      0
##   Manufacturing (Food stuffs)                                                                                                                    1
##   Manufacturing (Leather & products thereof)                                                                                                     0
##   Manufacturing (Machinery & Equipments)                                                                                                         1
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                                       1
##   Manufacturing (Others)                                                                                                                         1
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                                                0
##   Manufacturing (Textiles)                                                                                                                       0
##   Manufacturing (Wood Products)                                                                                                                  0
##   Mining & Quarrying                                                                                                                             0
##   Real Estate and Renting                                                                                                                        0
##   Trading                                                                                                                                        1
##   Transport, storage and Communications                                                                                                          0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       LIQUIDATED
##   Agriculture and Allied Activities                                                                        0
##   Business Services                                                                                        0
##   Community, personal & Social Services                                                                    1
##   Construction                                                                                             0
##   Electricity, Gas & Water companies                                                                       0
##   Finance                                                                                                  2
##   Insurance                                                                                                0
##   Manufacturing (Food stuffs)                                                                              1
##   Manufacturing (Leather & products thereof)                                                               1
##   Manufacturing (Machinery & Equipments)                                                                   2
##   Manufacturing (Metals & Chemicals, and products thereof)                                                 0
##   Manufacturing (Others)                                                                                   0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)          1
##   Manufacturing (Textiles)                                                                                 1
##   Manufacturing (Wood Products)                                                                            0
##   Mining & Quarrying                                                                                       0
##   Real Estate and Renting                                                                                  0
##   Trading                                                                                                  1
##   Transport, storage and Communications                                                                    0
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       STRIKE OFF
##   Agriculture and Allied Activities                                                                      549
##   Business Services                                                                                     1002
##   Community, personal & Social Services                                                                  414
##   Construction                                                                                           667
##   Electricity, Gas & Water companies                                                                      55
##   Finance                                                                                                942
##   Insurance                                                                                               11
##   Manufacturing (Food stuffs)                                                                            929
##   Manufacturing (Leather & products thereof)                                                             196
##   Manufacturing (Machinery & Equipments)                                                                 705
##   Manufacturing (Metals & Chemicals, and products thereof)                                              2056
##   Manufacturing (Others)                                                                                 103
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)        406
##   Manufacturing (Textiles)                                                                               478
##   Manufacturing (Wood Products)                                                                           95
##   Mining & Quarrying                                                                                     107
##   Real Estate and Renting                                                                                142
##   Trading                                                                                               1206
##   Transport, storage and Communications                                                                  151
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       UNDER LIQUIDATION
##   Agriculture and Allied Activities                                                                               8
##   Business Services                                                                                               7
##   Community, personal & Social Services                                                                           4
##   Construction                                                                                                    3
##   Electricity, Gas & Water companies                                                                              1
##   Finance                                                                                                        34
##   Insurance                                                                                                       0
##   Manufacturing (Food stuffs)                                                                                    14
##   Manufacturing (Leather & products thereof)                                                                      3
##   Manufacturing (Machinery & Equipments)                                                                          7
##   Manufacturing (Metals & Chemicals, and products thereof)                                                       60
##   Manufacturing (Others)                                                                                          0
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                 7
##   Manufacturing (Textiles)                                                                                       12
##   Manufacturing (Wood Products)                                                                                   0
##   Mining & Quarrying                                                                                              1
##   Real Estate and Renting                                                                                         0
##   Trading                                                                                                        12
##   Transport, storage and Communications                                                                           1
##                                                                                                  COMPANY_STATUS
## PRINCIPAL_BUSINESS_ACTIVITY                                                                       UNDER PROCESS OF STRIKING OFF
##   Agriculture and Allied Activities                                                                                          24
##   Business Services                                                                                                         210
##   Community, personal & Social Services                                                                                      53
##   Construction                                                                                                               66
##   Electricity, Gas & Water companies                                                                                          3
##   Finance                                                                                                                   329
##   Insurance                                                                                                                   3
##   Manufacturing (Food stuffs)                                                                                                27
##   Manufacturing (Leather & products thereof)                                                                                  5
##   Manufacturing (Machinery & Equipments)                                                                                     28
##   Manufacturing (Metals & Chemicals, and products thereof)                                                                   85
##   Manufacturing (Others)                                                                                                      5
##   Manufacturing (Paper & Paper products, Publishing, printing and reproduction of recorded media)                            18
##   Manufacturing (Textiles)                                                                                                   21
##   Manufacturing (Wood Products)                                                                                               3
##   Mining & Quarrying                                                                                                          9
##   Real Estate and Renting                                                                                                    53
##   Trading                                                                                                                   132
##   Transport, storage and Communications                                                                                      26
mytable5 <- xtabs(~ COMPANY_CATEGORY+COMPANY_CLASS, data=MBA)
mytable5
##                               COMPANY_CLASS
## COMPANY_CATEGORY               One Person Company Private Public
##   Company Limited by Guarantee                  0      67     62
##   Company Limited by Shares                   229   57621   7154
##   Unlimited Company                             0      20     12
mytable5 <- xtabs(~ REGISTRAR_OF_COMPANIES+COMPANY_CLASS, data=MBA)
mytable5
##                       COMPANY_CLASS
## REGISTRAR_OF_COMPANIES One Person Company Private Public
##             RoC-Kanpur                229   57708   7228

Data visualisation

Box Plots

Q5: Draw box plot of the variables

par(mfrow=c(1,1))
par(mfrow=c(1,2))
with(MBA, boxplot(MBA$AUTHORIZED_CAPITAL,main="Authorized Capital Average",ylab="Average"))
par(mfrow=c(1,3))

par(mfrow=c(1,1))
par(mfrow=c(1,2))
with(MBA, boxplot(MBA$PAIDUP_CAPITAL,main="Paidup Capital Average",ylab="Average"))
par(mfrow=c(1,3))

boxplot(MBA$PAIDUP_CAPITAL,horizontal = TRUE,outline = FALSE)

boxplot(MBA$AUTHORIZED_CAPITAL,horizontal = TRUE,outline = FALSE)

## Some Definitions:

Authorized Capital:

The authorised capital of a company is the maximum amount of share capital that the company is authorised by its constitutional documents to issue (allocate) to shareholders.

Paidup Capital: Paid-up capital is the amount of money a company has received from shareholders in exchange for shares of stock. Paid-up capital is created when a company sells its shares on the primary market, directly to investors.

The Difference(Authorized Capital - Paidup Capital)

So the task at hand is to find out the percentage of the paidup capital in the authorized capital. That is ., How much percentage of the authorized capital is the paidup capital ? We now create a new coloumn for it.