setwd("~/pye1pm")
library(fdth)
## 
## Attaching package: 'fdth'
## The following objects are masked from 'package:stats':
## 
##     sd, var
library(modeest)
## 
## Attaching package: 'modeest'
## The following object is masked from 'package:fdth':
## 
##     mfv
library(pacman)
p_load("DT","prettydoc","xfun","readr", "datasets", "ggplot2", "beanplot")

La siguiente variable corresponde a

naranjas <- Orange
names(naranjas)
## [1] "Tree"          "age"           "circumference"
naranjas
##    Tree  age circumference
## 1     1  118            30
## 2     1  484            58
## 3     1  664            87
## 4     1 1004           115
## 5     1 1231           120
## 6     1 1372           142
## 7     1 1582           145
## 8     2  118            33
## 9     2  484            69
## 10    2  664           111
## 11    2 1004           156
## 12    2 1231           172
## 13    2 1372           203
## 14    2 1582           203
## 15    3  118            30
## 16    3  484            51
## 17    3  664            75
## 18    3 1004           108
## 19    3 1231           115
## 20    3 1372           139
## 21    3 1582           140
## 22    4  118            32
## 23    4  484            62
## 24    4  664           112
## 25    4 1004           167
## 26    4 1231           179
## 27    4 1372           209
## 28    4 1582           214
## 29    5  118            30
## 30    5  484            49
## 31    5  664            81
## 32    5 1004           125
## 33    5 1231           142
## 34    5 1372           174
## 35    5 1582           177

Los datos anteriores corresponden a los datos de arboles de naranjas y posteriormente se hace la tabla de frecuencias donde: f= frecuencia absoluta rf= frecuencia relativa rf(%) frecuencia relativa porcentual cf= frecuencia acumulada cf(%)=frecuencia acumulada porcentual

tabla <- fdt(naranjas$age, breaks = "Sturges")
tabla
##         Class limits  f   rf rf(%) cf  cf(%)
##    [116.82,328.3914)  5 0.14 14.29  5  14.29
##  [328.3914,539.9629)  5 0.14 14.29 10  28.57
##  [539.9629,751.5343)  5 0.14 14.29 15  42.86
##  [751.5343,963.1057)  0 0.00  0.00 15  42.86
##  [963.1057,1174.677)  5 0.14 14.29 20  57.14
##  [1174.677,1386.249) 10 0.29 28.57 30  85.71
##   [1386.249,1597.82)  5 0.14 14.29 35 100.00

ahora ordenaremos los datos de menor a mayor

sort(naranjas$age)
##  [1]  118  118  118  118  118  484  484  484  484  484  664  664  664  664  664
## [16] 1004 1004 1004 1004 1004 1231 1231 1231 1231 1231 1372 1372 1372 1372 1372
## [31] 1582 1582 1582 1582 1582

Continuaremos con los histogramas de frecuencias

plot(tabla, type="fh")

Histograma de frecuencias relativas

plot(tabla, type="rfh")

Histograma de frecuencias acumuladas

plot(tabla, type="cfh")

Ahora se continuara con los poligonos

Polígono de frecuencias absolutas

plot(tabla, type="fp")

Polígono de frecuencias relativas

plot(tabla, type="rfp")

Polígono de frecuencias acumuladas

plot(tabla, type="cfp")

Ahora las medidas de tendencia central

Media

mean(naranjas$age)
## [1] 922.1429

Mediana

median(naranjas$age)
## [1] 1004

Moda

mlv(naranjas$age, method="mfv")
## [1]  118  484  664 1004 1231 1372 1582

Los cuartiles, valor minimo y maximo

summary(naranjas$age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   118.0   484.0  1004.0   922.1  1372.0  1582.0

El grafico de caja y bigote

boxplot(naranjas$age)

Continuaremos con las medidas de dispersion lineal

Varianzq

var(naranjas$age)
## [1] 241930.7

La desviación estándar

sd(naranjas$age)
## [1] 491.8645

Gráfico de dispersión lineal

plot(naranjas$age)

Analisis de regresion lineal

Tenemos los datos de cual es el numero de arbol, la edad del arbol y la circunferencia del tronco de naranjo.

Y con el fin de conocer la relacion de estas variables se elabora una matriz de diagramas de dispersion. Donde se puede ver una relacion clara entre la edad y la circunferencia.

pairs(naranjas)

A continuacion se aplicara la regla de los minimos cuadrados donde el comando basico es lm (linear models)

regresion <- lm(circumference ~ age, data = naranjas)
summary(regresion)
## 
## Call:
## lm(formula = circumference ~ age, data = naranjas)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -46.310 -14.946  -0.076  19.697  45.111 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 17.399650   8.622660   2.018   0.0518 .  
## age          0.106770   0.008277  12.900 1.93e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 23.74 on 33 degrees of freedom
## Multiple R-squared:  0.8345, Adjusted R-squared:  0.8295 
## F-statistic: 166.4 on 1 and 33 DF,  p-value: 1.931e-14

Intervalo de confianza

confint(regresion)
##                   2.5 %     97.5 %
## (Intercept) -0.14328303 34.9425835
## age          0.08993141  0.1236092
confint(regresion, level = 0.90)
##                   5 %       95 %
## (Intercept) 2.8070030 31.9922974
## age         0.0927633  0.1207774

Indice de correlacion de tipo pearson

cor(naranjas$age, naranjas$circumference)
## [1] 0.9135189

Ecuacion de la recta de los minimos cuadrados

\[ y = 17.399650 + 0.106770x \]

cor.test(naranjas$age, naranjas$circumference)
## 
##  Pearson's product-moment correlation
## 
## data:  naranjas$age and naranjas$circumference
## t = 12.9, df = 33, p-value = 1.931e-14
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.8342364 0.9557955
## sample estimates:
##       cor 
## 0.9135189
y = 17.399650 + 0.106770*(664)
y
## [1] 88.29493

A continuacion se muestra la grafica

plot(naranjas$age, naranjas$circumference, xlab="Edad de los arboles", ylab="Circunferencia del tronco")
abline(regresion)

Estimacion de predicciones

nuevas.edades <- data.frame(age = seq(100,1600))
predict(regresion, nuevas.edades)
##         1         2         3         4         5         6         7         8 
##  28.07668  28.18345  28.29022  28.39699  28.50376  28.61053  28.71730  28.82408 
##         9        10        11        12        13        14        15        16 
##  28.93085  29.03762  29.14439  29.25116  29.35793  29.46470  29.57147  29.67824 
##        17        18        19        20        21        22        23        24 
##  29.78501  29.89178  29.99855  30.10532  30.21209  30.31886  30.42563  30.53240 
##        25        26        27        28        29        30        31        32 
##  30.63917  30.74594  30.85271  30.95948  31.06625  31.17302  31.27979  31.38656 
##        33        34        35        36        37        38        39        40 
##  31.49333  31.60010  31.70687  31.81364  31.92041  32.02718  32.13396  32.24073 
##        41        42        43        44        45        46        47        48 
##  32.34750  32.45427  32.56104  32.66781  32.77458  32.88135  32.98812  33.09489 
##        49        50        51        52        53        54        55        56 
##  33.20166  33.30843  33.41520  33.52197  33.62874  33.73551  33.84228  33.94905 
##        57        58        59        60        61        62        63        64 
##  34.05582  34.16259  34.26936  34.37613  34.48290  34.58967  34.69644  34.80321 
##        65        66        67        68        69        70        71        72 
##  34.90998  35.01675  35.12352  35.23029  35.33706  35.44384  35.55061  35.65738 
##        73        74        75        76        77        78        79        80 
##  35.76415  35.87092  35.97769  36.08446  36.19123  36.29800  36.40477  36.51154 
##        81        82        83        84        85        86        87        88 
##  36.61831  36.72508  36.83185  36.93862  37.04539  37.15216  37.25893  37.36570 
##        89        90        91        92        93        94        95        96 
##  37.47247  37.57924  37.68601  37.79278  37.89955  38.00632  38.11309  38.21986 
##        97        98        99       100       101       102       103       104 
##  38.32663  38.43340  38.54017  38.64694  38.75372  38.86049  38.96726  39.07403 
##       105       106       107       108       109       110       111       112 
##  39.18080  39.28757  39.39434  39.50111  39.60788  39.71465  39.82142  39.92819 
##       113       114       115       116       117       118       119       120 
##  40.03496  40.14173  40.24850  40.35527  40.46204  40.56881  40.67558  40.78235 
##       121       122       123       124       125       126       127       128 
##  40.88912  40.99589  41.10266  41.20943  41.31620  41.42297  41.52974  41.63651 
##       129       130       131       132       133       134       135       136 
##  41.74328  41.85005  41.95683  42.06360  42.17037  42.27714  42.38391  42.49068 
##       137       138       139       140       141       142       143       144 
##  42.59745  42.70422  42.81099  42.91776  43.02453  43.13130  43.23807  43.34484 
##       145       146       147       148       149       150       151       152 
##  43.45161  43.55838  43.66515  43.77192  43.87869  43.98546  44.09223  44.19900 
##       153       154       155       156       157       158       159       160 
##  44.30577  44.41254  44.51931  44.62608  44.73285  44.83962  44.94639  45.05316 
##       161       162       163       164       165       166       167       168 
##  45.15993  45.26671  45.37348  45.48025  45.58702  45.69379  45.80056  45.90733 
##       169       170       171       172       173       174       175       176 
##  46.01410  46.12087  46.22764  46.33441  46.44118  46.54795  46.65472  46.76149 
##       177       178       179       180       181       182       183       184 
##  46.86826  46.97503  47.08180  47.18857  47.29534  47.40211  47.50888  47.61565 
##       185       186       187       188       189       190       191       192 
##  47.72242  47.82919  47.93596  48.04273  48.14950  48.25627  48.36304  48.46981 
##       193       194       195       196       197       198       199       200 
##  48.57659  48.68336  48.79013  48.89690  49.00367  49.11044  49.21721  49.32398 
##       201       202       203       204       205       206       207       208 
##  49.43075  49.53752  49.64429  49.75106  49.85783  49.96460  50.07137  50.17814 
##       209       210       211       212       213       214       215       216 
##  50.28491  50.39168  50.49845  50.60522  50.71199  50.81876  50.92553  51.03230 
##       217       218       219       220       221       222       223       224 
##  51.13907  51.24584  51.35261  51.45938  51.56615  51.67292  51.77969  51.88647 
##       225       226       227       228       229       230       231       232 
##  51.99324  52.10001  52.20678  52.31355  52.42032  52.52709  52.63386  52.74063 
##       233       234       235       236       237       238       239       240 
##  52.84740  52.95417  53.06094  53.16771  53.27448  53.38125  53.48802  53.59479 
##       241       242       243       244       245       246       247       248 
##  53.70156  53.80833  53.91510  54.02187  54.12864  54.23541  54.34218  54.44895 
##       249       250       251       252       253       254       255       256 
##  54.55572  54.66249  54.76926  54.87603  54.98280  55.08957  55.19635  55.30312 
##       257       258       259       260       261       262       263       264 
##  55.40989  55.51666  55.62343  55.73020  55.83697  55.94374  56.05051  56.15728 
##       265       266       267       268       269       270       271       272 
##  56.26405  56.37082  56.47759  56.58436  56.69113  56.79790  56.90467  57.01144 
##       273       274       275       276       277       278       279       280 
##  57.11821  57.22498  57.33175  57.43852  57.54529  57.65206  57.75883  57.86560 
##       281       282       283       284       285       286       287       288 
##  57.97237  58.07914  58.18591  58.29268  58.39946  58.50623  58.61300  58.71977 
##       289       290       291       292       293       294       295       296 
##  58.82654  58.93331  59.04008  59.14685  59.25362  59.36039  59.46716  59.57393 
##       297       298       299       300       301       302       303       304 
##  59.68070  59.78747  59.89424  60.00101  60.10778  60.21455  60.32132  60.42809 
##       305       306       307       308       309       310       311       312 
##  60.53486  60.64163  60.74840  60.85517  60.96194  61.06871  61.17548  61.28225 
##       313       314       315       316       317       318       319       320 
##  61.38902  61.49579  61.60256  61.70934  61.81611  61.92288  62.02965  62.13642 
##       321       322       323       324       325       326       327       328 
##  62.24319  62.34996  62.45673  62.56350  62.67027  62.77704  62.88381  62.99058 
##       329       330       331       332       333       334       335       336 
##  63.09735  63.20412  63.31089  63.41766  63.52443  63.63120  63.73797  63.84474 
##       337       338       339       340       341       342       343       344 
##  63.95151  64.05828  64.16505  64.27182  64.37859  64.48536  64.59213  64.69890 
##       345       346       347       348       349       350       351       352 
##  64.80567  64.91244  65.01922  65.12599  65.23276  65.33953  65.44630  65.55307 
##       353       354       355       356       357       358       359       360 
##  65.65984  65.76661  65.87338  65.98015  66.08692  66.19369  66.30046  66.40723 
##       361       362       363       364       365       366       367       368 
##  66.51400  66.62077  66.72754  66.83431  66.94108  67.04785  67.15462  67.26139 
##       369       370       371       372       373       374       375       376 
##  67.36816  67.47493  67.58170  67.68847  67.79524  67.90201  68.00878  68.11555 
##       377       378       379       380       381       382       383       384 
##  68.22232  68.32910  68.43587  68.54264  68.64941  68.75618  68.86295  68.96972 
##       385       386       387       388       389       390       391       392 
##  69.07649  69.18326  69.29003  69.39680  69.50357  69.61034  69.71711  69.82388 
##       393       394       395       396       397       398       399       400 
##  69.93065  70.03742  70.14419  70.25096  70.35773  70.46450  70.57127  70.67804 
##       401       402       403       404       405       406       407       408 
##  70.78481  70.89158  70.99835  71.10512  71.21189  71.31866  71.42543  71.53221 
##       409       410       411       412       413       414       415       416 
##  71.63898  71.74575  71.85252  71.95929  72.06606  72.17283  72.27960  72.38637 
##       417       418       419       420       421       422       423       424 
##  72.49314  72.59991  72.70668  72.81345  72.92022  73.02699  73.13376  73.24053 
##       425       426       427       428       429       430       431       432 
##  73.34730  73.45407  73.56084  73.66761  73.77438  73.88115  73.98792  74.09469 
##       433       434       435       436       437       438       439       440 
##  74.20146  74.30823  74.41500  74.52177  74.62854  74.73531  74.84209  74.94886 
##       441       442       443       444       445       446       447       448 
##  75.05563  75.16240  75.26917  75.37594  75.48271  75.58948  75.69625  75.80302 
##       449       450       451       452       453       454       455       456 
##  75.90979  76.01656  76.12333  76.23010  76.33687  76.44364  76.55041  76.65718 
##       457       458       459       460       461       462       463       464 
##  76.76395  76.87072  76.97749  77.08426  77.19103  77.29780  77.40457  77.51134 
##       465       466       467       468       469       470       471       472 
##  77.61811  77.72488  77.83165  77.93842  78.04519  78.15197  78.25874  78.36551 
##       473       474       475       476       477       478       479       480 
##  78.47228  78.57905  78.68582  78.79259  78.89936  79.00613  79.11290  79.21967 
##       481       482       483       484       485       486       487       488 
##  79.32644  79.43321  79.53998  79.64675  79.75352  79.86029  79.96706  80.07383 
##       489       490       491       492       493       494       495       496 
##  80.18060  80.28737  80.39414  80.50091  80.60768  80.71445  80.82122  80.92799 
##       497       498       499       500       501       502       503       504 
##  81.03476  81.14153  81.24830  81.35507  81.46185  81.56862  81.67539  81.78216 
##       505       506       507       508       509       510       511       512 
##  81.88893  81.99570  82.10247  82.20924  82.31601  82.42278  82.52955  82.63632 
##       513       514       515       516       517       518       519       520 
##  82.74309  82.84986  82.95663  83.06340  83.17017  83.27694  83.38371  83.49048 
##       521       522       523       524       525       526       527       528 
##  83.59725  83.70402  83.81079  83.91756  84.02433  84.13110  84.23787  84.34464 
##       529       530       531       532       533       534       535       536 
##  84.45141  84.55818  84.66496  84.77173  84.87850  84.98527  85.09204  85.19881 
##       537       538       539       540       541       542       543       544 
##  85.30558  85.41235  85.51912  85.62589  85.73266  85.83943  85.94620  86.05297 
##       545       546       547       548       549       550       551       552 
##  86.15974  86.26651  86.37328  86.48005  86.58682  86.69359  86.80036  86.90713 
##       553       554       555       556       557       558       559       560 
##  87.01390  87.12067  87.22744  87.33421  87.44098  87.54775  87.65452  87.76129 
##       561       562       563       564       565       566       567       568 
##  87.86806  87.97484  88.08161  88.18838  88.29515  88.40192  88.50869  88.61546 
##       569       570       571       572       573       574       575       576 
##  88.72223  88.82900  88.93577  89.04254  89.14931  89.25608  89.36285  89.46962 
##       577       578       579       580       581       582       583       584 
##  89.57639  89.68316  89.78993  89.89670  90.00347  90.11024  90.21701  90.32378 
##       585       586       587       588       589       590       591       592 
##  90.43055  90.53732  90.64409  90.75086  90.85763  90.96440  91.07117  91.17794 
##       593       594       595       596       597       598       599       600 
##  91.28472  91.39149  91.49826  91.60503  91.71180  91.81857  91.92534  92.03211 
##       601       602       603       604       605       606       607       608 
##  92.13888  92.24565  92.35242  92.45919  92.56596  92.67273  92.77950  92.88627 
##       609       610       611       612       613       614       615       616 
##  92.99304  93.09981  93.20658  93.31335  93.42012  93.52689  93.63366  93.74043 
##       617       618       619       620       621       622       623       624 
##  93.84720  93.95397  94.06074  94.16751  94.27428  94.38105  94.48782  94.59460 
##       625       626       627       628       629       630       631       632 
##  94.70137  94.80814  94.91491  95.02168  95.12845  95.23522  95.34199  95.44876 
##       633       634       635       636       637       638       639       640 
##  95.55553  95.66230  95.76907  95.87584  95.98261  96.08938  96.19615  96.30292 
##       641       642       643       644       645       646       647       648 
##  96.40969  96.51646  96.62323  96.73000  96.83677  96.94354  97.05031  97.15708 
##       649       650       651       652       653       654       655       656 
##  97.26385  97.37062  97.47739  97.58416  97.69093  97.79771  97.90448  98.01125 
##       657       658       659       660       661       662       663       664 
##  98.11802  98.22479  98.33156  98.43833  98.54510  98.65187  98.75864  98.86541 
##       665       666       667       668       669       670       671       672 
##  98.97218  99.07895  99.18572  99.29249  99.39926  99.50603  99.61280  99.71957 
##       673       674       675       676       677       678       679       680 
##  99.82634  99.93311 100.03988 100.14665 100.25342 100.36019 100.46696 100.57373 
##       681       682       683       684       685       686       687       688 
## 100.68050 100.78727 100.89404 101.00081 101.10759 101.21436 101.32113 101.42790 
##       689       690       691       692       693       694       695       696 
## 101.53467 101.64144 101.74821 101.85498 101.96175 102.06852 102.17529 102.28206 
##       697       698       699       700       701       702       703       704 
## 102.38883 102.49560 102.60237 102.70914 102.81591 102.92268 103.02945 103.13622 
##       705       706       707       708       709       710       711       712 
## 103.24299 103.34976 103.45653 103.56330 103.67007 103.77684 103.88361 103.99038 
##       713       714       715       716       717       718       719       720 
## 104.09715 104.20392 104.31069 104.41747 104.52424 104.63101 104.73778 104.84455 
##       721       722       723       724       725       726       727       728 
## 104.95132 105.05809 105.16486 105.27163 105.37840 105.48517 105.59194 105.69871 
##       729       730       731       732       733       734       735       736 
## 105.80548 105.91225 106.01902 106.12579 106.23256 106.33933 106.44610 106.55287 
##       737       738       739       740       741       742       743       744 
## 106.65964 106.76641 106.87318 106.97995 107.08672 107.19349 107.30026 107.40703 
##       745       746       747       748       749       750       751       752 
## 107.51380 107.62057 107.72735 107.83412 107.94089 108.04766 108.15443 108.26120 
##       753       754       755       756       757       758       759       760 
## 108.36797 108.47474 108.58151 108.68828 108.79505 108.90182 109.00859 109.11536 
##       761       762       763       764       765       766       767       768 
## 109.22213 109.32890 109.43567 109.54244 109.64921 109.75598 109.86275 109.96952 
##       769       770       771       772       773       774       775       776 
## 110.07629 110.18306 110.28983 110.39660 110.50337 110.61014 110.71691 110.82368 
##       777       778       779       780       781       782       783       784 
## 110.93046 111.03723 111.14400 111.25077 111.35754 111.46431 111.57108 111.67785 
##       785       786       787       788       789       790       791       792 
## 111.78462 111.89139 111.99816 112.10493 112.21170 112.31847 112.42524 112.53201 
##       793       794       795       796       797       798       799       800 
## 112.63878 112.74555 112.85232 112.95909 113.06586 113.17263 113.27940 113.38617 
##       801       802       803       804       805       806       807       808 
## 113.49294 113.59971 113.70648 113.81325 113.92002 114.02679 114.13356 114.24034 
##       809       810       811       812       813       814       815       816 
## 114.34711 114.45388 114.56065 114.66742 114.77419 114.88096 114.98773 115.09450 
##       817       818       819       820       821       822       823       824 
## 115.20127 115.30804 115.41481 115.52158 115.62835 115.73512 115.84189 115.94866 
##       825       826       827       828       829       830       831       832 
## 116.05543 116.16220 116.26897 116.37574 116.48251 116.58928 116.69605 116.80282 
##       833       834       835       836       837       838       839       840 
## 116.90959 117.01636 117.12313 117.22990 117.33667 117.44344 117.55022 117.65699 
##       841       842       843       844       845       846       847       848 
## 117.76376 117.87053 117.97730 118.08407 118.19084 118.29761 118.40438 118.51115 
##       849       850       851       852       853       854       855       856 
## 118.61792 118.72469 118.83146 118.93823 119.04500 119.15177 119.25854 119.36531 
##       857       858       859       860       861       862       863       864 
## 119.47208 119.57885 119.68562 119.79239 119.89916 120.00593 120.11270 120.21947 
##       865       866       867       868       869       870       871       872 
## 120.32624 120.43301 120.53978 120.64655 120.75332 120.86010 120.96687 121.07364 
##       873       874       875       876       877       878       879       880 
## 121.18041 121.28718 121.39395 121.50072 121.60749 121.71426 121.82103 121.92780 
##       881       882       883       884       885       886       887       888 
## 122.03457 122.14134 122.24811 122.35488 122.46165 122.56842 122.67519 122.78196 
##       889       890       891       892       893       894       895       896 
## 122.88873 122.99550 123.10227 123.20904 123.31581 123.42258 123.52935 123.63612 
##       897       898       899       900       901       902       903       904 
## 123.74289 123.84966 123.95643 124.06320 124.16998 124.27675 124.38352 124.49029 
##       905       906       907       908       909       910       911       912 
## 124.59706 124.70383 124.81060 124.91737 125.02414 125.13091 125.23768 125.34445 
##       913       914       915       916       917       918       919       920 
## 125.45122 125.55799 125.66476 125.77153 125.87830 125.98507 126.09184 126.19861 
##       921       922       923       924       925       926       927       928 
## 126.30538 126.41215 126.51892 126.62569 126.73246 126.83923 126.94600 127.05277 
##       929       930       931       932       933       934       935       936 
## 127.15954 127.26631 127.37309 127.47986 127.58663 127.69340 127.80017 127.90694 
##       937       938       939       940       941       942       943       944 
## 128.01371 128.12048 128.22725 128.33402 128.44079 128.54756 128.65433 128.76110 
##       945       946       947       948       949       950       951       952 
## 128.86787 128.97464 129.08141 129.18818 129.29495 129.40172 129.50849 129.61526 
##       953       954       955       956       957       958       959       960 
## 129.72203 129.82880 129.93557 130.04234 130.14911 130.25588 130.36265 130.46942 
##       961       962       963       964       965       966       967       968 
## 130.57619 130.68297 130.78974 130.89651 131.00328 131.11005 131.21682 131.32359 
##       969       970       971       972       973       974       975       976 
## 131.43036 131.53713 131.64390 131.75067 131.85744 131.96421 132.07098 132.17775 
##       977       978       979       980       981       982       983       984 
## 132.28452 132.39129 132.49806 132.60483 132.71160 132.81837 132.92514 133.03191 
##       985       986       987       988       989       990       991       992 
## 133.13868 133.24545 133.35222 133.45899 133.56576 133.67253 133.77930 133.88607 
##       993       994       995       996       997       998       999      1000 
## 133.99285 134.09962 134.20639 134.31316 134.41993 134.52670 134.63347 134.74024 
##      1001      1002      1003      1004      1005      1006      1007      1008 
## 134.84701 134.95378 135.06055 135.16732 135.27409 135.38086 135.48763 135.59440 
##      1009      1010      1011      1012      1013      1014      1015      1016 
## 135.70117 135.80794 135.91471 136.02148 136.12825 136.23502 136.34179 136.44856 
##      1017      1018      1019      1020      1021      1022      1023      1024 
## 136.55533 136.66210 136.76887 136.87564 136.98241 137.08918 137.19595 137.30273 
##      1025      1026      1027      1028      1029      1030      1031      1032 
## 137.40950 137.51627 137.62304 137.72981 137.83658 137.94335 138.05012 138.15689 
##      1033      1034      1035      1036      1037      1038      1039      1040 
## 138.26366 138.37043 138.47720 138.58397 138.69074 138.79751 138.90428 139.01105 
##      1041      1042      1043      1044      1045      1046      1047      1048 
## 139.11782 139.22459 139.33136 139.43813 139.54490 139.65167 139.75844 139.86521 
##      1049      1050      1051      1052      1053      1054      1055      1056 
## 139.97198 140.07875 140.18552 140.29229 140.39906 140.50584 140.61261 140.71938 
##      1057      1058      1059      1060      1061      1062      1063      1064 
## 140.82615 140.93292 141.03969 141.14646 141.25323 141.36000 141.46677 141.57354 
##      1065      1066      1067      1068      1069      1070      1071      1072 
## 141.68031 141.78708 141.89385 142.00062 142.10739 142.21416 142.32093 142.42770 
##      1073      1074      1075      1076      1077      1078      1079      1080 
## 142.53447 142.64124 142.74801 142.85478 142.96155 143.06832 143.17509 143.28186 
##      1081      1082      1083      1084      1085      1086      1087      1088 
## 143.38863 143.49540 143.60217 143.70894 143.81572 143.92249 144.02926 144.13603 
##      1089      1090      1091      1092      1093      1094      1095      1096 
## 144.24280 144.34957 144.45634 144.56311 144.66988 144.77665 144.88342 144.99019 
##      1097      1098      1099      1100      1101      1102      1103      1104 
## 145.09696 145.20373 145.31050 145.41727 145.52404 145.63081 145.73758 145.84435 
##      1105      1106      1107      1108      1109      1110      1111      1112 
## 145.95112 146.05789 146.16466 146.27143 146.37820 146.48497 146.59174 146.69851 
##      1113      1114      1115      1116      1117      1118      1119      1120 
## 146.80528 146.91205 147.01882 147.12560 147.23237 147.33914 147.44591 147.55268 
##      1121      1122      1123      1124      1125      1126      1127      1128 
## 147.65945 147.76622 147.87299 147.97976 148.08653 148.19330 148.30007 148.40684 
##      1129      1130      1131      1132      1133      1134      1135      1136 
## 148.51361 148.62038 148.72715 148.83392 148.94069 149.04746 149.15423 149.26100 
##      1137      1138      1139      1140      1141      1142      1143      1144 
## 149.36777 149.47454 149.58131 149.68808 149.79485 149.90162 150.00839 150.11516 
##      1145      1146      1147      1148      1149      1150      1151      1152 
## 150.22193 150.32870 150.43548 150.54225 150.64902 150.75579 150.86256 150.96933 
##      1153      1154      1155      1156      1157      1158      1159      1160 
## 151.07610 151.18287 151.28964 151.39641 151.50318 151.60995 151.71672 151.82349 
##      1161      1162      1163      1164      1165      1166      1167      1168 
## 151.93026 152.03703 152.14380 152.25057 152.35734 152.46411 152.57088 152.67765 
##      1169      1170      1171      1172      1173      1174      1175      1176 
## 152.78442 152.89119 152.99796 153.10473 153.21150 153.31827 153.42504 153.53181 
##      1177      1178      1179      1180      1181      1182      1183      1184 
## 153.63859 153.74536 153.85213 153.95890 154.06567 154.17244 154.27921 154.38598 
##      1185      1186      1187      1188      1189      1190      1191      1192 
## 154.49275 154.59952 154.70629 154.81306 154.91983 155.02660 155.13337 155.24014 
##      1193      1194      1195      1196      1197      1198      1199      1200 
## 155.34691 155.45368 155.56045 155.66722 155.77399 155.88076 155.98753 156.09430 
##      1201      1202      1203      1204      1205      1206      1207      1208 
## 156.20107 156.30784 156.41461 156.52138 156.62815 156.73492 156.84169 156.94847 
##      1209      1210      1211      1212      1213      1214      1215      1216 
## 157.05524 157.16201 157.26878 157.37555 157.48232 157.58909 157.69586 157.80263 
##      1217      1218      1219      1220      1221      1222      1223      1224 
## 157.90940 158.01617 158.12294 158.22971 158.33648 158.44325 158.55002 158.65679 
##      1225      1226      1227      1228      1229      1230      1231      1232 
## 158.76356 158.87033 158.97710 159.08387 159.19064 159.29741 159.40418 159.51095 
##      1233      1234      1235      1236      1237      1238      1239      1240 
## 159.61772 159.72449 159.83126 159.93803 160.04480 160.15157 160.25835 160.36512 
##      1241      1242      1243      1244      1245      1246      1247      1248 
## 160.47189 160.57866 160.68543 160.79220 160.89897 161.00574 161.11251 161.21928 
##      1249      1250      1251      1252      1253      1254      1255      1256 
## 161.32605 161.43282 161.53959 161.64636 161.75313 161.85990 161.96667 162.07344 
##      1257      1258      1259      1260      1261      1262      1263      1264 
## 162.18021 162.28698 162.39375 162.50052 162.60729 162.71406 162.82083 162.92760 
##      1265      1266      1267      1268      1269      1270      1271      1272 
## 163.03437 163.14114 163.24791 163.35468 163.46145 163.56823 163.67500 163.78177 
##      1273      1274      1275      1276      1277      1278      1279      1280 
## 163.88854 163.99531 164.10208 164.20885 164.31562 164.42239 164.52916 164.63593 
##      1281      1282      1283      1284      1285      1286      1287      1288 
## 164.74270 164.84947 164.95624 165.06301 165.16978 165.27655 165.38332 165.49009 
##      1289      1290      1291      1292      1293      1294      1295      1296 
## 165.59686 165.70363 165.81040 165.91717 166.02394 166.13071 166.23748 166.34425 
##      1297      1298      1299      1300      1301      1302      1303      1304 
## 166.45102 166.55779 166.66456 166.77134 166.87811 166.98488 167.09165 167.19842 
##      1305      1306      1307      1308      1309      1310      1311      1312 
## 167.30519 167.41196 167.51873 167.62550 167.73227 167.83904 167.94581 168.05258 
##      1313      1314      1315      1316      1317      1318      1319      1320 
## 168.15935 168.26612 168.37289 168.47966 168.58643 168.69320 168.79997 168.90674 
##      1321      1322      1323      1324      1325      1326      1327      1328 
## 169.01351 169.12028 169.22705 169.33382 169.44059 169.54736 169.65413 169.76090 
##      1329      1330      1331      1332      1333      1334      1335      1336 
## 169.86767 169.97444 170.08122 170.18799 170.29476 170.40153 170.50830 170.61507 
##      1337      1338      1339      1340      1341      1342      1343      1344 
## 170.72184 170.82861 170.93538 171.04215 171.14892 171.25569 171.36246 171.46923 
##      1345      1346      1347      1348      1349      1350      1351      1352 
## 171.57600 171.68277 171.78954 171.89631 172.00308 172.10985 172.21662 172.32339 
##      1353      1354      1355      1356      1357      1358      1359      1360 
## 172.43016 172.53693 172.64370 172.75047 172.85724 172.96401 173.07078 173.17755 
##      1361      1362      1363      1364      1365      1366      1367      1368 
## 173.28432 173.39110 173.49787 173.60464 173.71141 173.81818 173.92495 174.03172 
##      1369      1370      1371      1372      1373      1374      1375      1376 
## 174.13849 174.24526 174.35203 174.45880 174.56557 174.67234 174.77911 174.88588 
##      1377      1378      1379      1380      1381      1382      1383      1384 
## 174.99265 175.09942 175.20619 175.31296 175.41973 175.52650 175.63327 175.74004 
##      1385      1386      1387      1388      1389      1390      1391      1392 
## 175.84681 175.95358 176.06035 176.16712 176.27389 176.38066 176.48743 176.59420 
##      1393      1394      1395      1396      1397      1398      1399      1400 
## 176.70098 176.80775 176.91452 177.02129 177.12806 177.23483 177.34160 177.44837 
##      1401      1402      1403      1404      1405      1406      1407      1408 
## 177.55514 177.66191 177.76868 177.87545 177.98222 178.08899 178.19576 178.30253 
##      1409      1410      1411      1412      1413      1414      1415      1416 
## 178.40930 178.51607 178.62284 178.72961 178.83638 178.94315 179.04992 179.15669 
##      1417      1418      1419      1420      1421      1422      1423      1424 
## 179.26346 179.37023 179.47700 179.58377 179.69054 179.79731 179.90408 180.01086 
##      1425      1426      1427      1428      1429      1430      1431      1432 
## 180.11763 180.22440 180.33117 180.43794 180.54471 180.65148 180.75825 180.86502 
##      1433      1434      1435      1436      1437      1438      1439      1440 
## 180.97179 181.07856 181.18533 181.29210 181.39887 181.50564 181.61241 181.71918 
##      1441      1442      1443      1444      1445      1446      1447      1448 
## 181.82595 181.93272 182.03949 182.14626 182.25303 182.35980 182.46657 182.57334 
##      1449      1450      1451      1452      1453      1454      1455      1456 
## 182.68011 182.78688 182.89365 183.00042 183.10719 183.21397 183.32074 183.42751 
##      1457      1458      1459      1460      1461      1462      1463      1464 
## 183.53428 183.64105 183.74782 183.85459 183.96136 184.06813 184.17490 184.28167 
##      1465      1466      1467      1468      1469      1470      1471      1472 
## 184.38844 184.49521 184.60198 184.70875 184.81552 184.92229 185.02906 185.13583 
##      1473      1474      1475      1476      1477      1478      1479      1480 
## 185.24260 185.34937 185.45614 185.56291 185.66968 185.77645 185.88322 185.98999 
##      1481      1482      1483      1484      1485      1486      1487      1488 
## 186.09676 186.20353 186.31030 186.41707 186.52385 186.63062 186.73739 186.84416 
##      1489      1490      1491      1492      1493      1494      1495      1496 
## 186.95093 187.05770 187.16447 187.27124 187.37801 187.48478 187.59155 187.69832 
##      1497      1498      1499      1500      1501 
## 187.80509 187.91186 188.01863 188.12540 188.23217

Serian mas pero tuvo un limite

nuevas.edades <- data.frame(age = seq(100,1600))

#Gráfico de dispersión y recta 
plot(naranjas$age, naranjas$circumference, xlab="Edad de los arboles", ylab="Circunferencia del tronco")
abline(regresion)

xfun::embed_file("Tarea repaso.RMD")

Download Tarea repaso.RMD