r - 试图将 SAS GLM 翻译成 R sasLM::GLM
问题描述
我有一个这样的数据集:
X1 Record Plot Row Column Cp Csp Entry Year Location Genotype Trait Value Whole_plot
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr> <dbl> <chr>
1 3256 717 566 6 7 0 2 717 2019 Preston Novelty STD 5 6 + 7
2 3263 716 567 6 7 0 1 716 2019 Preston Flanders STD 4 6 + 7
3 3893 716 657 7 8 0 1 716 2019 Preston Flanders STD 2 7 + 8
4 3900 717 658 7 8 0 2 717 2019 Preston Novelty STD 2 7 + 8
5 4698 716 772 9 3 0 1 716 2019 Preston Flanders STD 3 9 + 3
6 4712 717 774 9 3 0 2 717 2019 Preston Novelty STD 3 9 + 3
7 3257 717 566 6 7 0 2 717 2019 Preston Novelty V1 5 6 + 7
8 3264 716 567 6 7 0 1 716 2019 Preston Flanders V1 4 6 + 7
9 3894 716 657 7 8 0 1 716 2019 Preston Flanders V1 3 7 + 8
10 3901 717 658 7 8 0 2 717 2019 Preston Novelty V1 3 7 + 8
SAS代码是
PROC GLM DATA=MAD.MDA_plot_subplot_controls outstat=MAD.subplot_control_anova_stat;
BY Year Location Trait;
CLASS Whole_plot Genotype;
MODEL Value = Whole_plot Genotype/SS3;
RANDOM Whole_plot;
LSMEANS Whole_plot;
RUN;
QUIT;
我试过的是这个
require(sasLM)
glm(Value ~ factor(Row) + factor(Column),MDA_plot_controls)
但我确实得到了一个错误
Error in glm(Value ~ factor(Row) + factor(Column), MDA_plot_controls) :
'family' not recognized
In addition: Warning message:
Unknown or uninitialised column: `family`.
我不明白“家庭”一栏。
解决方案
推荐阅读
- unit-testing - 如何验证在飞镖单元测试中作为参数传递的函数
- javascript - MongoDB 无法获取所有数据
- python - 从字符串中删除子字符串,如 lstrip 但不是单个字符
- delphi - Delphi DunitX,我如何获得当前正在运行的测试的名称?
- java - 仅当字符串包含字母、数字、空格或逗号时才打印字符串
- algorithm - 寻找最长交替序列长度的动态算法
- amazon-web-services - 如何在不使用预签名 URL 的情况下在 s3 私有存储桶中公开 s3 对象
- java - 将 Web 应用升级到 Spring Boot 2.4 后出现 IllegalStateException
- python - 如何将两个json文件合并为一个?
- swift - 您如何将纬度和经度存储为实时数据库中的 geohash?