在SAS中,我可以为一个n-of-1研究拟合线性混合效应模型,并且在比较Singer和Willett第7章中的示例后的多个相关结构时,它可以快速运行(参见http://statistics.ats.ucla.edu/stat/examples/alda.htm处的代码) 。我可以使用nlme中的lme
函数复制大多数相关结构的SAS结果,除了不相关的结构(SAS中的TYPE = UN
)。
在R中运行此模型时,如果数据集的大小相对较小,则R会请求一个淫秽的RAM。我的示例如下。根据上面链接的网站,第二个模型是SAS中的等效于TYPE = UN
的R,但是我收到了错误消息
Error: cannot allocate vector of size 46.4 Gb.
运行traceback()
会提供以下内容:
4: double(130 + (n * (n + 27))/2)
3: nlminb(c(coef(lmeSt)), function(lmePars) -logLik(lmeSt, lmePars),
control = control)
2: lme.formula(fixed = Mood ~ -1 + Day + I(Day^2) + I(Day^3) + CommuteTime,
data = happiness, random = ~1 | ID, correlation = corSymm(form = ~1 |
ID), method = "ML", na.action = na.omit)
1: lme(fixed = Mood ~ -1 + Day + I(Day^2) + I(Day^3) + CommuteTime,
data = happiness, random = ~1 | ID, correlation = corSymm(form = ~1 |
ID), method = "ML", na.action = na.omit)
回顾一下这些函数,我猜测追溯结尾的n
是我的样本大小的平方473^2
,在这种情况下double(130 + (n * (n + 27))/2)
给出类似的但不是相同的错误:
Error: cannot allocate vector of size 186.5 Gb
目前尚不清楚如何解决这个问题,因为应该有一种方法可以在SAS中复制结果。提前感谢任何提示。这是数据:
happiness <- structure(list(Mood = c(4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L,
2L, 0L, 0L, 3L, 0L, 0L, 0L, 3L, 2L, 3L, 0L, 0L, 2L, 0L, 2L, 2L,
4L, 3L, 0L, 0L, 0L, 0L, 0L, 2L, 2L, 2L, 2L, 2L, 0L, 2L, 2L, 2L,
0L, 0L, 2L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 3L, 0L, 4L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 2L, 3L, 0L, 2L, 0L,
2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1L, 3L, 0L, 0L,
2L, 1L, 0L, 1L, 0L, 2L, 2L, 0L, 1L, 0L, 0L, 2L, 1L, 1L, 2L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 1L, 0L, 1L, 2L, 4L, 1L, 1L,
1L, 0L, 4L, 3L, 0L, 0L, 1L, 0L, 0L, 2L, 1L, 0L, 0L, 1L, 2L,
2L, 3L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 5L, 0L, 0L, 1L, 3L, 0L,
0L, 1L, 0L, 0L, 5L, 1L, 0L, 2L, 1L, 0L, 3L, 0L, 2L, 1L, 0L,
1L, 0L, 0L, 0L, 1L, 1L, 2L, 4L, 3L, 1L, 1L, 0L, 2L, 4L, 0L,
0L, 3L, 1L, 0L, 0L, 5L, 0L, 0L, 6L, 0L, 0L, 2L),
ID = c(6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942, 6942,
6942, 6942),
Day = c(1L, 3L, 4L, 5L, 6L, 7L, 9L, 10L, 11L,
14L, 16L, 17L, 18L, 21L, 25L, 26L, 27L, 28L, 29L, 30L, 31L,
32L, 33L, 34L, 36L, 38L, 39L, 40L, 41L, 44L, 46L, 50L, 51L,
53L, 54L, 55L, 59L, 61L, 62L, 64L, 65L, 66L, 67L, 68L, 70L,
73L, 74L, 75L, 76L, 77L, 79L, 80L, 82L, 83L, 84L, 85L, 86L,
87L, 88L, 89L, 90L, 91L, 93L, 96L, 97L, 100L, 101L, 102L,
103L, 104L, 107L, 108L, 109L, 110L, 114L, 115L, 116L, 117L,
118L, 119L, 122L, 124L, 125L, 128L, 129L, 130L, 131L, 132L,
135L, 136L, 137L, 138L, 139L, 142L, 144L, 146L, 148L, 149L,
150L, 151L, 152L, 153L, 154L, 155L, 156L, 157L, 158L, 159L,
161L, 164L, 165L, 166L, 167L, 168L, 169L, 171L, 172L, 173L,
175L, 177L, 178L, 179L, 180L, 181L, 183L, 184L, 186L, 187L,
188L, 189L, 191L, 192L, 193L, 194L, 195L, 196L, 197L, 198L,
199L, 200L, 201L, 202L, 203L, 204L, 205L, 206L, 207L, 208L,
209L, 210L, 212L, 213L, 214L, 215L, 216L, 217L, 218L, 219L,
220L, 221L, 223L, 224L, 226L, 227L, 228L, 229L, 230L, 231L,
232L, 233L, 234L, 236L, 237L, 238L, 239L, 240L, 241L, 242L,
243L, 244L, 245L, 247L, 248L, 249L, 250L, 251L, 252L, 254L,
255L, 256L, 257L, 258L, 259L, 261L, 262L, 263L, 264L, 267L,
268L, 269L, 270L, 271L, 272L, 273L, 274L, 276L, 277L, 278L,
279L, 280L, 281L, 282L, 283L, 284L, 285L, 287L, 289L, 290L,
291L, 292L, 293L, 296L, 297L, 298L, 299L, 300L, 303L, 304L,
305L, 306L, 307L, 310L, 311L, 312L, 313L, 314L, 315L, 317L,
318L, 319L, 320L, 321L, 322L, 324L, 325L, 326L, 327L, 329L,
330L, 331L, 332L, 333L, 334L, 335L, 336L, 338L, 339L, 340L,
341L, 342L, 343L, 344L, 346L, 347L, 348L, 349L, 351L, 352L,
353L, 354L, 355L, 356L, 357L, 358L, 359L, 360L, 361L, 362L,
363L, 364L, 365L, 366L, 367L, 369L, 370L, 371L, 372L, 373L,
374L, 375L, 377L, 378L, 380L, 381L, 382L, 383L, 384L, 385L,
387L, 388L, 389L, 390L, 391L, 392L, 393L, 394L, 395L, 396L,
397L, 398L, 399L, 400L, 401L, 402L, 403L, 404L, 405L, 406L,
407L, 408L, 409L, 410L, 411L, 412L, 413L, 414L, 415L, 416L,
417L, 419L, 420L, 421L, 422L, 423L, 424L, 425L, 427L, 428L,
429L, 430L, 431L, 432L, 433L, 434L, 435L, 437L, 438L, 439L,
441L, 446L, 447L, 448L, 449L, 450L, 452L, 453L, 454L, 461L,
462L, 463L, 465L, 466L, 467L, 468L, 469L, 473L, 474L, 475L,
476L, 481L, 482L, 483L, 485L, 486L, 487L, 488L, 489L, 490L,
493L, 494L, 495L, 496L, 497L, 500L, 501L, 502L, 503L, 507L,
514L, 515L, 517L, 518L, 520L, 521L, 522L, 523L, 524L, 525L,
526L, 527L, 528L, 529L, 530L, 531L, 533L, 535L, 536L, 537L,
538L, 539L, 540L, 541L, 542L, 543L, 544L, 545L, 546L, 547L,
549L, 550L, 551L, 552L, 553L, 556L, 558L, 562L, 564L, 565L,
566L, 568L, 570L, 571L, 572L, 573L, 574L, 575L, 576L, 577L,
578L, 579L, 580L, 581L, 602L, 604L, 605L, 606L, 608L, 609L,
612L, 613L, 614L, 615L, 616L, 617L, 618L, 620L, 621L, 622L,
623L, 624L, 625L, 626L, 627L, 628L, 636L, 637L, 638L, 643L,
644L, 645L, 649L, 650L, 651L)),
.Names = c("Mood", "CommuteTime", "ID", "Day"),
row.names = c(7939L, 7941L, 7942L, 7943L, 7944L,
7945L, 7947L, 7948L, 7949L, 7952L, 7954L, 7955L, 7956L, 7959L,
7963L, 7964L, 7965L, 7966L, 7967L, 7968L, 7969L, 7970L, 7971L,
7972L, 7974L, 7976L, 7977L, 7978L, 7979L, 7982L, 7984L, 7988L,
7989L, 7991L, 7992L, 7993L, 7997L, 7999L, 8000L, 8002L, 8003L,
8004L, 8005L, 8006L, 8008L, 8011L, 8012L, 8013L, 8014L, 8015L,
8017L, 8018L, 8020L, 8021L, 8022L, 8023L, 8024L, 8025L, 8026L,
8027L, 8028L, 8029L, 8031L, 8034L, 8035L, 8038L, 8039L, 8040L,
8041L, 8042L, 8045L, 8046L, 8047L, 8048L, 8052L, 8053L, 8054L,
8055L, 8056L, 8057L, 8060L, 8062L, 8063L, 8066L, 8067L, 8068L,
8069L, 8070L, 8073L, 8074L, 8075L, 8076L, 8077L, 8080L, 8082L,
8084L, 8086L, 8087L, 8088L, 8089L, 8090L, 8091L, 8092L, 8093L,
8094L, 8095L, 8096L, 8097L, 8099L, 8102L, 8103L, 8104L, 8105L,
8106L, 8107L, 8109L, 8110L, 8111L, 8113L, 8115L, 8116L, 8117L,
8118L, 8119L, 8121L, 8122L, 8124L, 8125L, 8126L, 8127L, 8129L,
8130L, 8131L, 8132L, 8133L, 8134L, 8135L, 8136L, 8137L, 8138L,
8139L, 8140L, 8141L, 8142L, 8143L, 8144L, 8145L, 8146L, 8147L,
8148L, 8150L, 8151L, 8152L, 8153L, 8154L, 8155L, 8156L, 8157L,
8158L, 8159L, 8161L, 8162L, 8164L, 8165L, 8166L, 8167L, 8168L,
8169L, 8170L, 8171L, 8172L, 8174L, 8175L, 8176L, 8177L, 8178L,
8179L, 8180L, 8181L, 8182L, 8183L, 8185L, 8186L, 8187L, 8188L,
8189L, 8190L, 8192L, 8193L, 8194L, 8195L, 8196L, 8197L, 8199L,
8200L, 8201L, 8202L, 8205L, 8206L, 8207L, 8208L, 8209L, 8210L,
8211L, 8212L, 8214L, 8215L, 8216L, 8217L, 8218L, 8219L, 8220L,
8221L, 8222L, 8223L, 8225L, 8227L, 8228L, 8229L, 8230L, 8231L,
8234L, 8235L, 8236L, 8237L, 8238L, 8241L, 8242L, 8243L, 8244L,
8245L, 8248L, 8249L, 8250L, 8251L, 8252L, 8253L, 8255L, 8256L,
8257L, 8258L, 8259L, 8260L, 8262L, 8263L, 8264L, 8265L, 8267L,
8268L, 8269L, 8270L, 8271L, 8272L, 8273L, 8274L, 8276L, 8277L,
8278L, 8279L, 8280L, 8281L, 8282L, 8284L, 8285L, 8286L, 8287L,
8289L, 8290L, 8291L, 8292L, 8293L, 8294L, 8295L, 8296L, 8297L,
8298L, 8299L, 8300L, 8301L, 8302L, 8303L, 8304L, 8305L, 8307L,
8308L, 8309L, 8310L, 8311L, 8312L, 8313L, 8315L, 8316L, 8318L,
8319L, 8320L, 8321L, 8322L, 8323L, 8325L, 8326L, 8327L, 8328L,
8329L, 8330L, 8331L, 8332L, 8333L, 8334L, 8335L, 8336L, 8337L,
8338L, 8339L, 8340L, 8341L, 8342L, 8343L, 8344L, 8345L, 8346L,
8347L, 8348L, 8349L, 8350L, 8351L, 8352L, 8353L, 8354L, 8355L,
8357L, 8358L, 8359L, 8360L, 8361L, 8362L, 8363L, 8365L, 8366L,
8367L, 8368L, 8369L, 8370L, 8371L, 8372L, 8373L, 8375L, 8376L,
8377L, 8379L, 8384L, 8385L, 8386L, 8387L, 8388L, 8390L, 8391L,
8392L, 8399L, 8400L, 8401L, 8403L, 8404L, 8405L, 8406L, 8407L,
8411L, 8412L, 8413L, 8414L, 8419L, 8420L, 8421L, 8423L, 8424L,
8425L, 8426L, 8427L, 8428L, 8431L, 8432L, 8433L, 8434L, 8435L,
8438L, 8439L, 8440L, 8441L, 8445L, 8452L, 8453L, 8455L, 8456L,
8458L, 8459L, 8460L, 8461L, 8462L, 8463L, 8464L, 8465L, 8466L,
8467L, 8468L, 8469L, 8471L, 8473L, 8474L, 8475L, 8476L, 8477L,
8478L, 8479L, 8480L, 8481L, 8482L, 8483L, 8484L, 8485L, 8487L,
8488L, 8489L, 8490L, 8491L, 8494L, 8496L, 8500L, 8502L, 8503L,
8504L, 8506L, 8508L, 8509L, 8510L, 8511L, 8512L, 8513L, 8514L,
8515L, 8516L, 8517L, 8518L, 8519L, 8540L, 8542L, 8543L, 8544L,
8546L, 8547L, 8550L, 8551L, 8552L, 8553L, 8554L, 8555L, 8556L,
8558L, 8559L, 8560L, 8561L, 8562L, 8563L, 8564L, 8565L, 8566L,
8574L, 8575L, 8576L, 8581L, 8582L, 8583L, 8587L, 8588L, 8589L
),
na.action = structure(c(2L, 8L, 12L, 13L, 15L, 19L, 20L, 22L,
23L, 24L, 35L, 37L, 42L, 43L, 45L, 47L, 48L, 49L, 52L, 56L, 57L,
58L, 60L, 63L, 69L, 71L, 72L, 78L, 81L, 92L, 94L, 95L, 98L, 99L,
105L, 106L, 111L, 112L, 113L, 120L, 121L, 123L, 126L, 127L, 133L,
134L, 140L, 141L, 143L, 145L, 147L, 160L, 162L, 163L, 170L, 174L,
176L, 182L, 185L, 190L, 211L, 222L, 225L, 235L, 246L, 253L, 260L,
265L, 266L, 275L, 286L, 288L, 294L, 295L, 301L, 302L, 308L, 309L,
316L, 323L, 328L, 337L, 345L, 350L, 368L, 376L, 379L, 386L, 418L,
426L, 436L, 440L, 442L, 443L, 444L, 445L, 451L, 455L, 456L, 457L,
458L, 459L, 460L, 464L, 470L, 471L, 472L, 477L, 478L, 479L, 480L,
484L, 491L, 492L, 498L, 499L, 504L, 505L, 506L, 508L, 509L, 510L,
511L, 512L, 513L, 516L, 519L, 532L, 534L, 548L, 554L, 555L, 557L,
559L, 560L, 561L, 563L, 567L, 569L, 582L, 583L, 584L, 585L, 586L,
587L, 588L, 589L, 590L, 591L, 592L, 593L, 594L, 595L, 596L, 597L,
598L, 599L, 600L, 601L, 603L, 607L, 610L, 611L, 619L, 629L, 630L,
631L, 632L, 633L, 634L, 635L, 639L, 640L, 641L, 642L, 646L, 647L,
648L),
.Names = c("7940", "7946", "7950", "7951", "7953", "7957",
"7958", "7960", "7961", "7962", "7973", "7975", "7980", "7981",
"7983", "7985", "7986", "7987", "7990", "7994", "7995", "7996",
"7998", "8001", "8007", "8009", "8010", "8016", "8019", "8030",
"8032", "8033", "8036", "8037", "8043", "8044", "8049", "8050",
"8051", "8058", "8059", "8061", "8064", "8065", "8071", "8072",
"8078", "8079", "8081", "8083", "8085", "8098", "8100", "8101",
"8108", "8112", "8114", "8120", "8123", "8128", "8149", "8160",
"8163", "8173", "8184", "8191", "8198", "8203", "8204", "8213",
"8224", "8226", "8232", "8233", "8239", "8240", "8246", "8247",
"8254", "8261", "8266", "8275", "8283", "8288", "8306", "8314",
"8317", "8324", "8356", "8364", "8374", "8378", "8380", "8381",
"8382", "8383", "8389", "8393", "8394", "8395", "8396", "8397",
"8398", "8402", "8408", "8409", "8410", "8415", "8416", "8417",
"8418", "8422", "8429", "8430", "8436", "8437", "8442", "8443",
"8444", "8446", "8447", "8448", "8449", "8450", "8451", "8454",
"8457", "8470", "8472", "8486", "8492", "8493", "8495", "8497",
"8498", "8499", "8501", "8505", "8507", "8520", "8521", "8522",
"8523", "8524", "8525", "8526", "8527", "8528", "8529", "8530",
"8531", "8532", "8533", "8534", "8535", "8536", "8537", "8538",
"8539", "8541", "8545", "8548", "8549", "8557", "8567", "8568",
"8569", "8570", "8571", "8572", "8573", "8577", "8578", "8579",
"8580", "8584", "8585", "8586"), class = "omit"),
class = "data.frame")
这里有两个模型,一个与AR(1)运行正常的模型和不相关的结构给我带来了问题。
library(nlme)
# this runs very fast
mod.ar1 <- lme( fixed = Mood ~ -1 + Day + I(Day^2) +
I(Day^3) + CommuteTime,
data = happiness,
random = ~ 1 | ID ,
correlation = corAR1(),
method = "ML",
na.action = na.omit)
# this fails, not enough memory
mod.un <- lme( fixed = Mood ~ Day + I(Day^2) +
I(Day^3) + CommuteTime,
data = happiness,
random = ~ 1 | ID,
correlation = corSymm(form = ~ 1 |ID),
method = "ML",
na.action = na.omit)
这是会话信息,FWIW我可以将多台Windows机器上的错误和R版本复制回2.1。
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1