[R-es] Efectos fijos y aleatorios en un modelo lineal

Igor Sosa Mayor joseleopoldo1792 en gmail.com
Jue Mar 22 07:31:28 CET 2012


muchas gracias a todos Vds. por esta interesante discusión.



On Mon, Mar 19, 2012 at 02:21:48PM +0100, Fernando Piston wrote:
> Hola a todos,
> 
> Tengo algunas dudas sobre como introducir en un modelo lineal
> factores con efectos fijos y aleatorios. Mi diseño es el siguiente:
> 
> Factores
> 
> Line: 40 líneas de trigo (Fijo)
> 
> Rep: 3 Bloques (Aleatorio)
> 
> Year: 2 Años (Aleatorio)
> 
> 
> Variable dependiente
> 
> alpha.ug.mg
> 
> 
> Nota: Adjunto tabla de datos
> 
> 
> Dentro del diseño, 'Rep' y 'Year' se considera de efectos aleatorios
> y 'Line' es de efecto fijo.
> 
> 
> Lo he intento llevar a cabo con la función 'lmer' del paquete 'lme4',
> 
> lmer(alpha.ug.mg ~ Line + (1|Year) + (1|Rep%in%Year) +
> (1|Line:Year), data = Dataset)
> 
> 
> pero el modelo anterior me considera como error del factor 'line' el
> error de los residuales en lugar del error de Year*Line.
> 
> ¿como puede decirle al modelo que para 'line' me considere el error
> de 'Year*Line'?
> 
> 
> Gracias
> 
> 

> "Line","Rep","Year","alpha.ug.mg"
> "22A",3,2010,109.0593497549
> "22A",2,2010,42.7826500879
> "22A",1,2010,41.7181299556
> "22C",1,2010,38.1991350764
> "22C",3,2010,37.0710412795
> "22C",2,2010,37.6421869893
> "24A",2,2010,49.8022655225
> "24A",3,2010,158.3610621563
> "24A",1,2010,46.600174678
> "24B",1,2010,39.9050105701
> "24B",3,2010,38.5866594819
> "24B",2,2010,39.2276447861
> "28A",3,2010,48.2336226787
> "28A",1,2010,11.0610727009
> "28A",2,2010,16.2956567141
> "28B",1,2010,7.6341948368
> "28B",3,2010,33.2891616055
> "28B",2,2010,12.6674922676
> "A1152",1,2010,45.9373059739
> "A1152",2,2010,48.6810359048
> "A1152",3,2010,44.9822199521
> "A1158",3,2010,112.8194544702
> "A1158",2,2010,84.884470821
> "A1158",1,2010,41.8375111278
> "A1406",2,2010,88.2133648569
> "A1406",1,2010,56.6354788755
> "A1406",3,2010,53.6017778359
> "BW2003",3,2010,24.9542007258
> "BW2003",2,2010,33.2325222144
> "BW2003",1,2010,25.6420551785
> "BW208",1,2010,28.5872922864
> "BW208",2,2010,46.7223026582
> "BW208",3,2010,32.8353998213
> "C217",3,2010,105.366127876
> "C217",2,2010,46.1999270771
> "C217",1,2010,36.9372212397
> "C655",1,2010,39.1229394021
> "C655",2,2010,50.4050647949
> "C655",3,2010,40.0417380039
> "C657",3,2010,155.5650505723
> "C657",2,2010,43.9232577554
> "C657",1,2010,34.7879730776
> "D445",2,2010,69.5935781826
> "D445",3,2010,176.8939334121
> "D445",1,2010,43.7897162031
> "D577",3,2010,96.7154641172
> "D577",2,2010,68.0327017751
> "D577",1,2010,40.9510273403
> "D598",1,2010,40.4757468379
> "D598",3,2010,43.5580472412
> "D598",2,2010,30.001414697
> "D623",3,2010,54.3021389209
> "D623",2,2010,63.0973194355
> "D623",1,2010,44.34153501
> "D682",1,2010,35.5829780696
> "D682",2,2010,68.6790012285
> "D682",3,2010,153.4641515742
> "D715",2,2010,54.2993994709
> "D715",3,2010,34.5488694961
> "D715",1,2010,38.0889653755
> "D716",1,2010,39.6369203599
> "D716",2,2010,46.1001183105
> "D716",3,2010,40.1694883989
> "D770",2,2010,14.2685417747
> "D770",3,2010,13.0435917646
> "D770",1,2010,10.4078230406
> "D783",1,2010,11.4626811519
> "D783",2,2010,14.0145781614
> "D783",3,2010,11.5784518455
> "D793",1,2010,6.8843852871
> "D793",2,2010,6.8362938804
> "D793",3,2010,4.8261608269
> "D815",2,2010,37.8570289431
> "D815",3,2010,37.9437110068
> "D815",1,2010,39.6146545552
> "D874",3,2010,7.0639692271
> "D874",2,2010,3.5520231033
> "D874",1,2010,7.9021240352
> "D876",2,2010,7.0751333711
> "D876",1,2010,3.8653152622
> "D876",3,2010,7.4607721245
> "D894",3,2010,13.3918987898
> "D894",2,2010,12.5927256256
> "D894",1,2010,6.2048572762
> "E122",2,2010,18.1265720527
> "E122",3,2010,10.6709781268
> "E122",1,2010,13.7393565942
> "E140",2,2010,10.7770890613
> "E140",1,2010,12.7122106086
> "E140",3,2010,12.3701512314
> "E146",2,2010,13.2918707192
> "E146",3,2010,29.6476873967
> "E146",1,2010,11.6746645967
> "E33",1,2010,11.9509754653
> "E33",3,2010,13.7272529339
> "E33",2,2010,6.1771243638
> "E35",1,2010,13.4317067687
> "E35",2,2010,10.5776066338
> "E35",3,2010,10.6569263276
> "E39",1,2010,18.7578403236
> "E39",3,2010,14.8901895049
> "E39",2,2010,16.2749814419
> "E42",1,2010,11.2705763691
> "E42",2,2010,11.7726187666
> "E42",3,2010,10.2902579651
> "E76",3,2010,3.9932459224
> "E76",1,2010,5.2861970566
> "E76",2,2010,5.05359904
> "E82",3,2010,2.1061296409
> "E82",2,2010,6.5656761528
> "E82",1,2010,5.0782477827
> "E83",2,2010,4.9043513755
> "E83",3,2010,1.8900464681
> "E83",1,2010,4.227106061
> "E93",2,2010,10.0824452871
> "E93",3,2010,8.1817788899
> "E93",1,2010,8.5565306429
> "E96",1,2010,7.3894182357
> "E96",3,2010,7.786625775
> "E96",2,2010,10.5561352305
> "22A",1,2011,34.829069174
> "22A",2,2011,32.258984121
> "22A",3,2011,33.7328338282
> "22C",1,2011,26.3065289749
> "22C",2,2011,33.5803235742
> "22C",3,2011,61.6510379236
> "24A",1,2011,33.5743918647
> "24A",2,2011,27.1303390594
> "24A",3,2011,38.5034034733
> "24B",1,2011,29.5305734307
> "24B",2,2011,22.6777711265
> "24B",3,2011,37.904091319
> "28A",1,2011,8.8901525135
> "28A",2,2011,9.5618594658
> "28A",3,2011,8.725192148
> "28B",1,2011,9.339843909
> "28B",2,2011,8.3028317433
> "28B",3,2011,9.5309696356
> "A1152",1,2011,32.8649820765
> "A1152",2,2011,35.3029653156
> "A1152",3,2011,67.1288467513
> "A1158",1,2011,33.1900087512
> "A1158",2,2011,27.6586930167
> "A1158",3,2011,35.8875927168
> "A1406",1,2011,39.454877201
> "A1406",2,2011,48.5541965633
> "A1406",3,2011,60.5943767014
> "BW2003",1,2011,21.289550426
> "BW2003",2,2011,21.6131216575
> "BW2003",3,2011,41.8584332022
> "BW208",1,2011,24.2358886636
> "BW208",2,2011,25.1806535434
> "BW208",3,2011,74.6716176383
> "C217",1,2011,29.9978203375
> "C217",2,2011,25.2399716487
> "C217",3,2011,27.7970841392
> "C655",1,2011,33.3089175544
> "C655",2,2011,28.5412241211
> "C655",3,2011,103.7829812684
> "C657",1,2011,30.8928973039
> "C657",2,2011,26.4139354295
> "C657",3,2011,87.8629539796
> "D445",1,2011,27.2901901412
> "D445",2,2011,38.6422855086
> "D445",3,2011,114.2591728151
> "D577",1,2011,30.2376680245
> "D577",2,2011,31.070662585
> "D577",3,2011,26.3975249434
> "D598",1,2011,29.801279358
> "D598",2,2011,26.4864226539
> "D598",3,2011,28.0723445454
> "D623",1,2011,24.8761948703
> "D623",2,2011,28.1161651202
> "D623",3,2011,36.7188445453
> "D682",1,2011,23.375347608
> "D682",2,2011,25.3567799186
> "D682",3,2011,34.6696871575
> "D715",1,2011,20.6786000604
> "D715",2,2011,29.592803649
> "D715",3,2011,32.5525148514
> "D716",1,2011,28.5120167139
> "D716",2,2011,26.6924645784
> "D716",3,2011,31.7838387593
> "D770",1,2011,7.7987542924
> "D770",2,2011,9.6546898579
> "D770",3,2011,6.6618978177
> "D783",1,2011,9.0978371276
> "D783",2,2011,10.2521698348
> "D783",3,2011,8.8416345023
> "D793",1,2011,5.5452287028
> "D793",2,2011,4.9580977733
> "D793",3,2011,5.6492453598
> "D815",1,2011,28.2802166277
> "D815",2,2011,26.1136848918
> "D815",3,2011,25.8822083241
> "D874",1,2011,3.2018630354
> "D874",2,2011,2.1913909858
> "D874",3,2011,7.4290206167
> "D876",1,2011,3.9020605267
> "D876",2,2011,6.9259132422
> "D876",3,2011,2.9026336117
> "D894",1,2011,8.7064579179
> "D894",2,2011,8.356389618
> "D894",3,2011,9.9339637655
> "E122",1,2011,11.4219636664
> "E122",2,2011,10.916424566
> "E122",3,2011,10.5223912062
> "E140",1,2011,8.5898669874
> "E140",2,2011,7.9982271351
> "E140",3,2011,10.4810270596
> "E146",1,2011,7.9409494807
> "E146",2,2011,8.2938582855
> "E146",3,2011,8.3228436957
> "E33",1,2011,8.1243644859
> "E33",2,2011,7.4263307272
> "E33",3,2011,4.9739413268
> "E35",1,2011,7.5665324158
> "E35",2,2011,8.3122759171
> "E35",3,2011,10.4296259424
> "E39",1,2011,11.8741678148
> "E39",2,2011,13.266234577
> "E39",3,2011,14.2084710967
> "E42",1,2011,8.2925566086
> "E42",2,2011,7.3415039074
> "E42",3,2011,7.4414674656
> "E76",1,2011,3.6239562883
> "E76",2,2011,2.6182624754
> "E76",3,2011,1.6006447436
> "E82",1,2011,3.0953501391
> "E82",2,2011,3.0308393994
> "E82",3,2011,4.9933250149
> "E83",1,2011,3.5863512146
> "E83",2,2011,1.259391421
> "E83",3,2011,3.0620435559
> "E93",1,2011,5.5012379275
> "E93",2,2011,8.0870117498
> "E93",3,2011,5.8034051747
> "E96",1,2011,4.598860158
> "E96",2,2011,5.7612440555
> "E96",3,2011,6.41961799

> _______________________________________________
> R-help-es mailing list
> R-help-es en r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es


-- 
:: Igor Sosa Mayor     :: joseleopoldo1792 en gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/      ::
:: jabberid: rogorido  ::                            ::
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: no disponible
Type: application/pgp-signature
Size: 230 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20120322/a175ff7c/attachment.bin>


Más información sobre la lista de distribución R-help-es