版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
R题目1:根据MEdata数据集的拟合结果,预测当GDP依次为6500、7500、8500、10000、12000、15000时的TAX值并绘制(预测TAX~GDP)散点图代码:>abc<-read.csv("D:/R/MEdata.csv",header=T)>attach(abc)>LM<-lm(TAX~GDP)>gdp<-c(6500,7500,8500,10000,12000,15000)>tax<-predict(LM,data.frame(GDP=gdp))>tax12341188.3331375.4631562.5921843.286562217.5452778.933>plot(tax~gdp)截图:
rmCl1sl=1s())abc<-read.csvCD:『R/MEdaia.csv",header=attacfi(abc)LM<-lm(T4X-GDPj>gdp<-c(6500,7500,8500,10000,12000,15000>tax<-predict(LNBdata.frameCGDP=gdp)5>plot(tax~qdp)题目2>plot(tax~qdp)提取1993-2013年的TAX和GDP,与刚才的TAX~GDP预测值合并绘制合并后的(TAX~GDP)散点图代码:>t<-abc[16:36,"TAX"]>tax<-c(t,tax)>g<-abc[16:36,"GDP"]>gdp<-c(g,gdp)>plot(tax~gdp)运行结果截图
将DataC数据集,使用各种曲线方程进行拟合找出其最符合哪种曲线类型,并求出其拟合方程分析其拟合可信度决定系数、校正决定系数代码:>abc<-read.csv("C:/Users/user/Desktop/DataA-C/DataC.csv",header=T)>data<-abc[1:99,]>x<-c(1:99)>lines(x,fitted(lmzb))>lmpf<-lm(data~exp(x))>lines(x,fitted(lmpf))>lmpf<-lm(data~exp(x))
>lines(x,fitted(lmpf))>lmlg<-lm(data~log(x))>lines(x,fitted(lmlg))>lm1<-lm(data~xA2)>lines(x,fitted(lm1))>summary(lm1)Call:lm(formula=data~x^2)Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.11Residualstandarderror:2.564on97degreesoffreedom3F-statistic:1215on1and97DF,p-value:<2.2e-16MultipleR-squared:0.926,MultipleR-squared:0.926,AdjustedR-squared:0.925>summary(lmzb)Call:lm(formula=data~x)Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:2.564on97degreesoffreedomMultipleR-squared:0.926,AdjustedR-squared:0.9253F-statistic:1215on1and97DF,p-value:<2.2e-16>lm2<-lm(data~xA3)>lines(x,fitted(lm2))>summary(lm2)Call:lm(formula=data~x^3)Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***x***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:2.564on97degreesoffreedomMultipleR-squared:0.926,AdjustedR-squared:0.9253F-statistic:1215on1and97DF,p-value:<2.2e-16>lm3<-lm(data~xA4)>lines(x,fitted(lm3))>summary(lm3)Call:lm(formula=data~x^4)Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***x***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:2.564on97degreesoffreedomMultipleR-squared:0.926,AdjustedR-squared:0.9253F-statistic:1215on1and97DF,p-value:<2.2e-16>lm4<-lm(data~(xA2+x)+)>line(x~fitted(lm4))Call:line(x~fitted(lm4))Coefficients:[1]17.3463.231>lines(x~fitted(lm4))>summary(lm4)Call:lm(formula=data~(xA2+x))Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***x***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:2.564on97degreesoffreedomMultipleR-squared:0.926,AdjustedR-squared:0.9253F-statistic:1215on1and97DF,p-value:<2.2e-16>lm5<-lm(data~(l(xA2)))>summary(lm5)Call:lm(formula=data~(I(x^2)))Residuals:Min1QMedian3QMax-1.9939-0.5952-0.17670.50522.8117Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-0.3321010.146471-2.2670.0256I(xA2)0.0031470.00003395.376<2e-16(Intercept)*I(xA2)***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:0.9685on97degreesoffreedomMultipleR-squared:0.9894,AdjustedR-squared:0.9893F-statistic:9097on1and97DF,p-value:<2.2e-16>lm6<-lm(data~xA3)>summary(lm6)Call:lm(formula=data~xA3)Residuals:Min1QMedian3QMax-4.1099-1.9491-0.20971.75606.6147Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-5.6070230.519329-10.80<2e-16x0.3142770.00901834.85<2e-16(Intercept)***x***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:2.564on97degreesoffreedomMultipleR-squared:0.926,AdjustedR-squared:0.9253F-statistic:1215on1and97DF,p-value:<2.2e-16>lm7<-lm(data~l(xA3))>lines(x,fitted(lm7))>summary(lm7)Call:lm(formula=data~I(x^3))Residuals:Min1QMedian3QMax-4.2920-1.35950.01251.12994.6468Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)1.993e+002.440e-018.171.17e-12I(xA3)3.278e-056.537e-0750.15<2e-16(Intercept)***l(xA3)***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:1.817on97degreesoffreedomMultipleR-squared:0.9629,AdjustedR-squared:0.9625F-statistic:2515on1and97DF,p-value:<2.2e-16>lm8(data~l(x+xA2))Error:couldnotfindfunction"lm8">lm8<-lm(data~l(x+xA2))>lines(x,fitted(lm8))>summary(lm8)Call:lm(formula=data~I(x+x^2))Residuals:Min1QMedian3QMax-1.9444-0.5931-0.14100.52662.8217Coefficients:EstimateStd.Errortvalue(Intercept)-3.907e-011.472e-01-2.655I(x+xA2)3.118e-033.274e-0595.227Pr(>|t|)(Intercept)0.00927**I(x+xA2)<2e-16***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:0.97on97degreesoffreedomMultipleR-squared:0.9894,AdjustedR-squared:0.9893F-statistic:9068on1and97DF,p-value:<2.2e-16截图
0200204060somo题目4:针对MEdata数据集分析TAX与EXP.IE.RS、COM、INV、DEP中的哪些变量更为相关?代码:>xyz<-read.csv("C:/Users/user/Desktop/MEdata.csv",header=T)>xyzX119782197931980419815198261983719848198591986101987111988121989131990TAX5.19285.37825.71706.29897.00027.75599.473520.407920.907321.403623.904727.274028.2186GDP
36.056
40.926
45.929
50.088
55.900
62.162
73.627
90.767
105.085
122.774
153.886
173.113
193.478EXP11.220912.817912.288311.384112.299814.095217.010220.042522.049122.621824.912128.237830.8359IE3.5504.5465.7007.3537.7138.60112.01020.66725.80430.84238.21841.56055.60114151617181920212223242526272829303132333435361234567891011121314151617181920199129.9017225.77433.866272.258199232.9691275.65237.422091.196199342.5530369.38146.4230112.710199451.2688502.17457.9262203.819199560.3804632.16968.2372234.999199669.0982741.63679.3755241.338199782.3404816.58592.3356269.672199892.6280865.316107.9818268.4971999106.8258911.250131.8767298.9622000125.8151987.490158.8650392.7322001153.01381090.280189.0258421.8362002176.36451204.756220.5315513.7822003200.17311366.134246.4995704.8352004241.65681609.566284.8689955.3912005287.78541874.234339.30281169.2182006348.04352227.125404.22731409.7402007456.21972665.992497.81351668.6372008542.23793159.746625.92661799.2152009595.21593487.751762.99931506.4812010732.10794028.165898.74162017.2222011897.38394726.1921092.47792364.02020121006.14285293.9921259.52972441.60220131105.30705866.7301402.12102582.529RS15.58618.00021.40023.50025.70028.49433.76443.05049.50058.20074.40081.01483.00194.156109.937142.704186.229236.138283.602312.529COM
17.5910
20.1150
23.3120
26.2790
29.0290
32.3110
37.4200
46.8740
53.0210
61.2610
78.6810
88.1260
94.5090
107.3060
130.0010
164.1210
218.4420
283.6970
339.5590
369.2150INV8.0088.5659.1099.61012.30414.30118.32925.43231.20637.91747.53844.10445.17055.94580.801130.723170.421200.193229.135249.411DEP2.10602.81003.95805.23706.75408.925012.147016.226022.385030.814038.222051.964071.196092.4490117.5730152.0350215.1880296.6230385.2080462.798021333.781392.2930284.062534.075022356.479419.2040298.547596.218023391.057458.5460329.177643.324024430.554494.3590372.135737.624025481.359530.5660434.999869.106526525.163576.4980555.6661036.173127595.010652.1850704.7741195.553928671.766729.5870887.7361410.509929791.452825.75451099.9821615.873030935.716963.32501373.2391725.3419311148.3011116.70401728.2842178.8535321326.7841235.84622245.9882607.7166331569.9841407.58652516.8383033.0249341839.1861689.56633114.8513436.3589352103.0701905.84603746.9473995.5104362378.0992121.87504470.7444607.8504>attach(xyz)>lm1<-lm(TAX~GDP)>summary(lm1)Call:lm(formula=TAX~GDP)Residuals:Min1QMedian3QMax-42.459-29.5557.86124.98243.489Coefficients:EstimateStd.Errortvalue(Intercept)-28.0072966.274253-4.464GDP0.1871290.00306761.015Pr(>|t|)(Intercept)8.42e-05***GDP<2e-16***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:29.35on34degreesoffreedomMultipleR-squared:0.9909,AdjustedR-squared:0.9907F-statistic:3723on1and34DF,p-value:<2.2e-16>lm2<-lm(TAX~EXP)>summary(lm2)Call:lm(formula=TAX~EXP)Residuals:Min1QMedian3QMax-28.316-7.063-1.0191.28951.037Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)4.1825862.8122521.4870.146EXP0.8055230.006217129.574<2e-16(Intercept)EXP***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:13.87on34degreesoffreedomMultipleR-squared:0.998,AdjustedR-squared:0.9979F-statistic:1.679e+04on1and34DF,p-value:<2.2e-16>lm3(TAX~IE)Error:couldnotfindfunction"lm3">lm3<-lm(TAX~IE)>summay(lm3)Error:couldnotfindfunction"summay">summary(lm3)Call:lm(formula=TAX~IE)Residuals:Min1QMedian3QMax-157.24-5.9515.0821.15168.98Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-12.8475913.45009-0.9550.346IE0.367540.0133827.464<2e-16(Intercept)IE***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:64.06on34degreesoffreedomMultipleR-squared:0.9569,AdjustedR-squared:0.9556F-statistic:754.3on1and34DF,p-value:<2.2e-16>lm4<-lm(TAX~RS)>summary(lm4)Call:lm(formula=TAX~RS)Residuals:Min1QMedian3QMax-42.104-20.4298.07220.38939.790Coefficients:EstimateStd.Errortvalue(Intercept)-25.6423985.278005-4.858RS0.4802320.00664172.310Pr(>|t|)(Intercept)2.62e-05***RS<2e-16***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:24.79on34degreesoffreedomMultipleR-squared:0.9935,AdjustedR-squared:0.9933F-statistic:5229on1and34DF,p-value:<2.2e-16>lm5<-lm(TAX~COM)>summary(lm5)Call:lm(formula=TAX~COM)Residuals:Min1QMedian3QMax-67.95-49.9516.5239.0455.87Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-47.514199.87685-4.8113.02e-05COM0.526190.0131939.889<2e-16(Intercept)***COM***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:44.62on34degreesoffreedomMultipleR-squared:0.9791,AdjustedR-squared:0.9785F-statistic:1591on1and34DF,p-value:<2.2e-16>lm6<-lm(TAX~INV)>summary(lm6)Call:lm(formula=TAX~INV)Residuals:Min1QMedian3QMax-104.522-17.408-9.94329.18968.614Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)23.0831606.3171343.6540.000862INV0.2654470.00475255.857<2e-16(Intercept)***INV***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:32.03on34degreesoffreedomMultipleR-squared:0.9892,AdjustedR-squared:0.9889F-statistic:3120on1and34DF,p-value:<2.2e-16>lm7<-lm(TAX~DEP)>summary(lm7)Call:lm(formula=TAX~DEP)Residuals:Min1QMedian3QMax-49.80-24.1511.2517.2565.52Coefficients:EstimateStd.ErrortvaluePr(>|t|)(Intercept)-6.5647865.718265-1.1480.259DEP0.2439870.00377264.686<2e-16(Intercept)DEP***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:27.69on34degreesoffreedomMultipleR-squared:0.9919,AdjustedR-squared:0.9917F-statistic:4184on1and34DF,p-value:<2.2e-16由此可知与的关系更为相关题目5:■针对数据集,已知其与两个简单曲线方程有关请根据模型检验,找出其与哪些方程相关,以及其相关系数是多少?■代码:>abc<-read.csv("C:/Users/win7/Desktop/DataA-C/DataB.csv",header=F)>abcV1
1234567891011121314151617181920212223242526272829303132333435363738394041424344-2.0911972.9522886.023324-3.5570935.5373746.5981684.2457805.2801046.2366446.3298878.6984228.32484110.24123814.07337618.12848216.34914416.63697116.98641418.81848530.24750625.13226525.04794227.04835631.65876830.16883929.93538538.09426735.44903340.68458540.19215448.63689346.29322148.04168051.17622650.36272054.37714254.02988159.29702065.24711867.60230776.27848971.71407275.40390680.238131
454647484950515253545556575859606162636465666768697071727374757677787980818283848586878881.26698084.57445787.44804590.36404295.95851699.50945099.111906106.373772108.443331112.435114118.763071124.769167131.913452128.599940139.747729135.526574145.099765154.966973151.465719153.871099160.227186170.011253165.754177177.823482182.318694184.009418187.750679191.153594196.270428204.224860213.460813211.819805213.197897220.349255228.504785232.048823237.796630243.210018245.053094254.158638262.800697267.972826273.219992276.111804
89282.55521990285.41641691294.77052492301.68558893312.08789294316.08454095317.76325096326.54665197328.36617698340.75461199347.448750100357.363351>min(abc)[1]-3.557093>data<-abc[1:100,"V1"]>data[1]-2.0911972.9522886.023324[4]-3.5570935.5373746.598168[7]4.2457805.2801046.236644[10]6.3298878.6984228.324841[13]10.24123814.07337618.128482[16]16.34914416.63697116.986414[19]18.81848530.24750625.132265[22]25.04794227.04835631.658768[25]30.16883929.93538538.094267[28]35.44903340.68458540.192154[31]48.63689346.29322148.041680[34]51.17622650.36272054.377142[37]54.02988159.29702065.247118[40]67.60230776.27848971.714072[43]75.40390680.23813181.266980[46]84.57445787.44804590.364042[49]95.95851699.50945099.111906[52]106.373772108.443331112.435114[55]118.763071124.769167131.913452[58]128.599940139.747729135.526574[61]145.099765154.966973151.465719[64]153.871099160.227186170.011253[67]165.754177177.823482182.318694[70]184.009418187.750679191.153594[73]196.270428204.224860213.460813[76]211.819805213.197897220.349255[79]228.504785232.048823237.796630[82]243.210018245.053094254.158638[85]262.800697267.972826273.219992[88]276.111804282.555219285.416416[91]294.770524301.685588312.087892[94]316.084540317.763250326.546651[97]328.366176340.754611347.448750[100]357.363351>x<-c(1:100)>data<-data+4>lm1<-lm(data~x)>summary(lm1)Call:lm(formula=data~x)Residuals:Min1QMedian3QMax-29.95-20.22-6.2916.7154.06Coefficients:EstimateStd.Error(Intercept)-48.292554.67322x3.555990.08034tvaluePr(>|t|)(Intercept)-10.33<2e-16***x44.26<2e-16***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:23.19on98degreesoffreedomMultipleR-squared:0.9524,AdjustedR-squared:0.9519F-statistic:1959on1and98DF,p-value:<2.2e-16>lm2<-lm(data~exp(x))>summary(lm2)Call:lm(formula=data~exp(x))Residuals:Min1QMedian3QMax-125.87-91.01-24.7883.81198.48Coefficients:EstimateStd.Error(Intercept)1.263e+021.018e+01exp(x)1.169e-413.523e-42tvaluePr(>|t|)(Intercept)12.402<2e-16***exp(x)3.3190.00127**Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:100.7on98degreesoffreedomMultipleR-squared:0.101,AdjustedR-squared:0.09186F-statistic:11.01on1and98DF,p-value:0.00127lm3<-lm(data~l(x人2))>summary(lm3)Call:lm(formula=data~I(x人2))Residuals:Min1QMedian3Q-13.2379-2.99450.27672.4609Max11.6001Coefficients:EstimateStd.Error(Intercept)1.312e+016.708e-01I(x人2)3.492e-021.481e-04tvaluePr(>|t|)(Intercept)19.56<2e-16***I(x人2)235.76<2e-16***Signif.codes:0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1Residualstandarderror:4.458on98degreesoffreedomMultipleR-squared:0.9982,AdjustedR-squared:0.9982F-statistic:5.558e+04on1and98DF,p-value:<2.2e-16>lm4<-lm(data~I(1/x))>summary(lm4)Call:lm(formula=data~I(1/x))Residuals:Min1QMedian3QMax-109.06-86.86-28.2672.93215.99Coefficients:EstimateStd.Errortvalue(Intercept)148.7310.7
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- ZNO基变阻器材料相关行业投资规划报告
- 职教中心美育实施计划方案
- 小学一年级六一儿童节方案
- 某乡镇河长制工作存在问题专项整改实施方案
- 亮光涂装打磨房方案
- 安全设施设计专篇
- 小学三年规划方案
- 洗车池施工方案
- 宪法日主题活动方案
- 残疾儿童送教上门工作方案
- 20世纪时尚流行文化智慧树知到期末考试答案章节答案2024年浙江理工大学
- (完整版)苏教版五年级数学上册知识点归纳总结
- lampsite LTE 站点配置指导v1.1
- 市政工程钢筋混凝土管砂石基础垫层量计算公式
- 第七章 生态旅游标准与认证
- 美能达807si相机中文说明书
- 莆田市人教版四年级数学上册期中测试卷
- 输血科标准操作规程SOP文件
- 县人大常委会预算审查监督暂行办法
- 结肠代食道术护理体会
- 中大型集团公司 信息化建设 信息中心工作职责 明细
评论
0/150
提交评论