Posts

Showing posts from October, 2013

Statistics One (Coursera)

Image
Assignment:4 Assignment 4 deadline got over today. So i am putting the assignment 4 questions and answers here. Hope it will help others to solve the questions.  setwd("  ") library(psych) PE=read.table("Stats1.13.HW.04.txt",header = T) describe(PE) #Question1: What is the correlation between salary and years of professional experience? cor(PE[2:4]) round(cor(PE[2:4]),2)            salary     years   courses salary  1.0000000 0.7448961 0.5410249 years   0.7448961 1.0000000 0.3336635 courses 0.5410249 0.3336635 1.0000000 > round(cor(PE[2:4]),2)         salary years courses salary    1.00  0.74    0.54 years     0.74  1.00    0.33 courses   0.54  0.33    1.00 #Question2: What is the correlation between salary and courses completed? round(cor(PE$salary, PE$courses),2) [1] 0.54 #Question3: What is the percentage of variance explained in a regression model with salary as the outcome variable and professional ex