R Codes Used for my Dissertation