|
损失数据分析简介稳定1.5:按实体类型、火灾等级和,和NoClaim CreditVariableNumber of PoliciesClaimFrequencyAverageSeverityTypeVillage 1341 0.452 10645 City 793 1.941 16924 County 328 4.899 15453 Misc 609 0.186 43036 School 1597 1.434 64346 Town 971 0.103 19831 Fire5=0 2508 0.502 13935 Fire5=1 3131 1.596 41421 NoClaimCredit=0 3786 1.501 31365 NoClaimCredit=1 1853 0.310 30499总计5639 1.109 31206R索赔代码按实体列出的摘要类型、火灾等级和无索赔CreditByVarSumm<-函数(datasub){tempA<-summaryBy(频率1,数据=datasub,FUN=函数(x){c(m=平均值(x),num=长度(x))})datasub1<-子集(datasub,yAvg>0)tempB<-summaryBy(yAvg 1,数据=datasub1,FUN=函数(x){c(m=平均值(x))})tempC<-合并(tempA,tempB,all.x=T)[c(2,1,3)]tempC1<-tempC1作为。矩阵(tempC)return(tempC1)}datasub<-子集(Insample,TypeVillage==1);t1<-ByVarSumm(datasub)datasub<-子集(样本中,类型城市==1);t2<-ByVarSumm(datasub)datasub<-子集(在样本中,TypeCounty==1);t3<-BYVARSUM(datasub)datasub<-子集(样本中,类型MISC==1);t4<-ByVarSumm(datasub)datasub<-子集(在样本中,类型学校==1);t5<-ByVarSumm(datasub)datasub<-子集(在样本中,TypeTown==1);t6<-ByVarSumm(datasub)datasub<-子集(在样本中,Fire5==0);t7<-ByVarSumm(datasub)datasub<-子集(在样本中,Fire5==1);t8<-ByVarSumm(datasub)datasub<-子集(Insample,Insample$NoClaimCredit==0);t9<-ByVarSumm(datasub)datasub<-子集(inssample,inssample$NoClaimCredit==1);t10<-BYVARSUM(datasub)t11<-BYVARSUM(INSSAMPLE)表格A<-rbind(t1、t2、t3、t4、t5、t6、t7、t8、t9、t10、t11)表格AA<-圆形(表格A、3)1.3。
|