Explore

# Import data
data <- read.csv("data/belknap2016.csv", skip = 1) # 1st row is the description of variables

# Sturecture of data
str(data)
## 'data.frame':    215 obs. of  38 variables:
##  $ DoNo     : Factor w/ 215 levels "211-2016-CV-00001",..: 1 2 3 4 5 6 7 8 9 10 ...
##  $ CaseType : int  17 21 4 4 34 2 2 2 2 2 ...
##  $ FileDate : Factor w/ 132 levels "1/11/2016","1/12/2016",..: 12 12 13 13 14 1 1 2 3 3 ...
##  $ PNames   : Factor w/ 185 levels "Advanced Restaurant Finance, LLC",..: 13 123 135 135 10 40 41 77 112 8 ...
##  $ DNames   : Factor w/ 208 levels "223 D.W. Highway, LLC",..: 176 194 96 116 51 184 67 143 1 27 ...
##  $ ProSe    : Factor w/ 5 levels "Both","Defendant",..: 3 3 2 2 2 3 2 3 3 3 ...
##  $ PLaw     : Factor w/ 116 levels "9","Alex F. Mattera",..: 103 59 6 6 37 73 73 26 99 91 ...
##  $ PFirm    : Factor w/ 97 levels "9","Abrahamsen Ratchford, P.C.",..: 88 56 28 28 73 95 95 74 47 77 ...
##  $ EqReq    : Factor w/ 3 levels "No","Unknown",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ MonReq   : Factor w/ 67 levels "$0.00 ","$1,118,000 ",..: 67 67 3 24 48 65 35 16 44 61 ...
##  $ DLaw     : Factor w/ 99 levels "9","Allison M. Ambrose",..: 51 53 1 1 1 87 1 80 1 1 ...
##  $ DFirm    : Factor w/ 80 levels "9","Azarian Law Office, PLLC",..: 64 49 1 1 1 41 1 71 1 1 ...
##  $ X3d      : Factor w/ 9 levels "0","Andrew Howe; Martina Howe",..: 1 2 1 1 1 1 1 1 1 1 ...
##  $ X3dLaw   : Factor w/ 5 levels "0","Donald A. Kennedy",..: 1 3 1 1 1 1 1 1 1 1 ...
##  $ X3dFirm  : Factor w/ 6 levels "0","Law Office of Donald A. Kennedy",..: 1 5 1 1 1 1 1 1 1 1 ...
##  $ CtrCl    : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ CrsCl    : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Rec      : Factor w/ 3 levels "Ignatius","MacLeod; Borenstein",..: NA NA NA NA NA NA NA NA NA NA ...
##  $ Judge    : Factor w/ 19 levels "Delker; Nadeau; O'Neill; Fauver",..: NA 10 NA 10 10 10 19 10 10 NA ...
##  $ Rem      : Factor w/ 3 levels "HRC","Removed",..: NA NA NA NA NA NA NA NA NA NA ...
##  $ OthMot   : Factor w/ 98 levels "Ascented Motion to Continue",..: 98 77 98 98 4 20 21 64 98 98 ...
##  $ MTime    : Factor w/ 4 levels "0","1","1;2",..: 1 1 1 2 1 1 1 4 1 1 ...
##  $ MTA      : int  0 0 0 0 0 1 1 0 1 0 ...
##  $ MTD      : int  0 1 0 0 1 0 0 1 0 0 ...
##  $ DSJ      : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ PSJ      : Factor w/ 5 levels "0","1","1;3",..: 1 1 1 1 1 2 1 1 1 1 ...
##  $ DMIL     : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ PMIL     : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Stp      : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Arb      : Factor w/ 1 level "Yes": NA NA NA NA NA NA NA NA NA NA ...
##  $ TrialType: int  9 9 9 9 2 9 9 9 9 9 ...
##  $ DISP     : int  3 1 7 7 1 10 6 1 7 7 ...
##  $ JMent    : int  NA 2 NA NA NA NA 1 2 NA NA ...
##  $ NOJ      : int  9 9 9 9 9 9 2 9 9 9 ...
##  $ Award    : Factor w/ 42 levels "$1,700.74 ","$1,733.52 ",..: 41 41 41 41 41 41 28 41 41 41 ...
##  $ Eq       : Factor w/ 5 levels "$34,000 ","1",..: 5 5 5 5 5 5 1 5 5 5 ...
##  $ TermDate : Factor w/ 150 levels "1/10/2017","1/12/2017",..: 83 83 70 68 111 NA 150 127 93 59 ...
##  $ Enforce  : int  0 0 0 0 0 0 1 0 0 0 ...

# Basic descriptive statistics of data
summary(data)
##                 DoNo        CaseType           FileDate  
##  211-2016-CV-00001:  1   Min.   : 1.00   5/2/2016  :  8  
##  211-2016-CV-00002:  1   1st Qu.: 2.00   5/20/2016 :  6  
##  211-2016-CV-00003:  1   Median :16.00   9/26/2016 :  5  
##  211-2016-CV-00004:  1   Mean   :19.09   9/7/2016  :  5  
##  211-2016-CV-00005:  1   3rd Qu.:37.00   10/31/2016:  4  
##  211-2016-CV-00006:  1   Max.   :45.00   3/8/2016  :  4  
##  (Other)          :209                   (Other)   :183  
##                                                PNames   
##  Barcklay Bank Delaware                           :  7  
##  Concord Hospital                                 :  5  
##  American Express Centurion Bank                  :  4  
##  Discover Bank                                    :  4  
##  Monique A. Twomey Revocable Trust; Monique Twomey:  4  
##  American Express Bank FSB                        :  3  
##  (Other)                                          :188  
##                                                                                                               DNames   
##  Town of Gilford                                                                                                 :  6  
##  Barry K. Meyers; Brenda M. Stowe                                                                                :  2  
##  City of Laconia                                                                                                 :  2  
##  223 D.W. Highway, LLC                                                                                           :  1  
##  Adam L. Anderson                                                                                                :  1  
##  Ahmed Ali; Marcia Arsnow; Hasan Duymazlar; Scott Horton; Huggins Hopsital; Silvia Milancovici; Nicholas Quarshie:  1  
##  (Other)                                                                                                         :202  
##        ProSe                         PLaw    
##  Both     : 18   9                     : 30  
##  Defendant: 77   Robert L. O'Brien     : 17  
##  Neither  :106   Michael J. Fontaine   :  6  
##  Plaintiff: 12   Matthew J. Lahey      :  5  
##  Some DF  :  2   Michael J. Fontane    :  5  
##                  Christopher J. Seufert:  4  
##                  (Other)               :148  
##                                PFirm         EqReq             MonReq   
##  9                                : 30   No     : 35   1          :107  
##  Schlee & Stillman, LLC           : 17   Unknown:  1   0          : 43  
##  Welts, White, & Fontaine, P.C.   : 11   Yes    :177   $0.00      :  1  
##  Martin, Lord, & Osman, P.A.      :  8   NA's   :  2   $1,118,000 :  1  
##  Zwicker & Associates, P.C.       :  7                 $1,435.87  :  1  
##  Haughey, Philpot, & Laurent, P.A.:  4                 $1,670.09  :  1  
##  (Other)                          :138                 (Other)    : 61  
##                    DLaw    
##  9                   : 98  
##  Laura Spector-Morgan:  4  
##  Daniel J. Orroth    :  3  
##  Jeffrey T. Philpot  :  3  
##  Joseph D. Becher    :  3  
##  Laurence W. Getman  :  3  
##  (Other)             :101  
##                                         DFirm   
##  9                                         :98  
##  Getman, Schulthess, Steere, & Poulin, P.A.: 9  
##  Mitchell Municipal Group, P.A.            : 7  
##  Getman, Schulthess, & Steere, P.A.        : 4  
##  Civil Bureau                              : 3  
##  Jeffrey T. Philpot, P.C.                  : 3  
##  (Other)                                   :91  
##                             X3d                         X3dLaw   
##  0                            :202   0                     :207  
##  Andrew Howe; Martina Howe    :  4   Donald A. Kennedy     :  2  
##  Angela Pearl                 :  2   Ethan G. Wood         :  4  
##  Donald A. Kennedy            :  2   Frank P. Spinella, Jr.:  1  
##  Belknap County Superior Court:  1   Gregg M. Charest      :  1  
##  Christopher Savage           :  1                               
##  (Other)                      :  3                               
##                              X3dFirm        CtrCl        
##  0                               :207   Min.   :0.00000  
##  Law Office of Donald A. Kennedy :  1   1st Qu.:0.00000  
##  Law Office of Gregg M. Charest  :  1   Median :0.00000  
##  Law Offices of Donald A. Kennedy:  1   Mean   :0.05581  
##  Patrick Wood Law Office, PLLC   :  4   3rd Qu.:0.00000  
##  Wadleigh, Starr, & Peters, PLLC :  1   Max.   :2.00000  
##                                                          
##      CrsCl                           Rec                  Judge    
##  Min.   :0.000000   Ignatius           :  4   O'Neill        :154  
##  1st Qu.:0.000000   MacLeod; Borenstein:  1   Fauver; O'Neill:  3  
##  Median :0.000000   O'Neill            :  2   O'Neill; Fauver:  3  
##  Mean   :0.009302   NA's               :208   Fauver         :  2  
##  3rd Qu.:0.000000                             Nadeau         :  2  
##  Max.   :1.000000                             (Other)        : 20  
##                                               NA's           : 31  
##        Rem                                       OthMot   MTime    
##  HRC     :  1   None                                :86   0  :163  
##  Removed :  6   Motion for Entry of Final Judgment  :18   1  : 10  
##  Transfer:  1   Motion for Voluntary Nonsuit        : 6   1;2:  1  
##  NA's    :207   Assented to Motion to Continue      : 3   2  : 41  
##                 Assented to Motion to Continue Trial: 3            
##                 Motion to Strike                    : 3            
##                 (Other)                             :96            
##       MTA              MTD               DSJ           PSJ     
##  Min.   :0.0000   Min.   : 0.0000   Min.   :0.00000   0  :206  
##  1st Qu.:0.0000   1st Qu.: 0.0000   1st Qu.:0.00000   1  :  5  
##  Median :0.0000   Median : 0.0000   Median :0.00000   1;3:  1  
##  Mean   :0.1535   Mean   : 0.3116   Mean   :0.07477   3  :  2  
##  3rd Qu.:0.0000   3rd Qu.: 0.0000   3rd Qu.:0.00000   6  :  1  
##  Max.   :1.0000   Max.   :10.0000   Max.   :3.00000            
##                                     NA's   :1                  
##       DMIL               PMIL              Stp           Arb     
##  Min.   : 0.00000   Min.   :0.00000   Min.   :0.0000   Yes : 34  
##  1st Qu.: 0.00000   1st Qu.:0.00000   1st Qu.:0.0000   NA's:181  
##  Median : 0.00000   Median :0.00000   Median :0.0000             
##  Mean   : 0.09302   Mean   :0.04186   Mean   :0.4279             
##  3rd Qu.: 0.00000   3rd Qu.:0.00000   3rd Qu.:1.0000             
##  Max.   :10.00000   Max.   :6.00000   Max.   :2.0000             
##                                                                  
##    TrialType          DISP            JMent            NOJ       
##  Min.   :0.000   Min.   : 1.000   Min.   :1.000   Min.   :0.000  
##  1st Qu.:9.000   1st Qu.: 3.000   1st Qu.:1.000   1st Qu.:0.000  
##  Median :9.000   Median : 3.000   Median :1.000   Median :1.000  
##  Mean   :8.349   Mean   : 4.977   Mean   :2.589   Mean   :2.744  
##  3rd Qu.:9.000   3rd Qu.: 8.000   3rd Qu.:2.000   3rd Qu.:9.000  
##  Max.   :9.000   Max.   :10.000   Max.   :9.000   Max.   :9.000  
##                                   NA's   :108                    
##          Award            Eq           TermDate      Enforce      
##  0          :163   $34,000 :  1   Open     : 18   Min.   :0.0000  
##  1          : 12   1       :  1   11/1/2016:  4   1st Qu.:0.0000  
##  $1,700.74  :  1   2       :  1   4/13/2017:  4   Median :0.0000  
##  $1,733.52  :  1   3       :  2   5/18/2017:  4   Mean   :0.1116  
##  $10,611.22 :  1   9       :210   8/31/2017:  4   3rd Qu.:0.0000  
##  $11,117.22 :  1                  (Other)  :179   Max.   :3.0000  
##  (Other)    : 36                  NA's     :  2

Nature of Suit

#Convert case type to plain English
#data$CaseType[data$CaseType == 1] = "Contract - Construction"

library(tidyverse)
#data$CaseType <- factor(data$CaseType)

data %>%
  count(CaseType) %>%
  arrange(desc(n)) %>%
  as.data.frame()
##    CaseType  n
## 1         2 66
## 2        37 29
## 3        35 18
## 4        27 17
## 5        38 14
## 6         4 11
## 7        13  8
## 8         1  6
## 9        11  6
## 10       40  6
## 11        6  5
## 12       14  5
## 13       21  5
## 14       17  3
## 15       34  3
## 16       36  3
## 17       16  2
## 18       44  2
## 19       22  1
## 20       39  1
## 21       41  1
## 22       42  1
## 23       43  1
## 24       45  1