我必须在以下运行R A t.test: 如果是单身的YearsAtCompany低于已婚R中运行T.Test比较两个不同的列
意义不知何故,我需要比较YearsatCompany与婚姻状况
我曾尝试:
t.test(EmployeeAttrition$YearsAtCompany[Single],EmployeeAttrition$YearsAtCompany[Married],alternative = "less")
但是,这是不正确给我的信息。我在R方面相当新颖,并且在这里研究了其他问题,仍然无法获得正确的代码。
的样本数据:
的[在矩阵的行选择r多个条件]可能的复制(https://stackoverflow.com/questions/13762402/r-multiple-conditions-in-row-selection-of-matrix) – kabanus
待办事项**不**将数据发布为图像或图形文件,请编辑您的问题并发布'dput(EmployeeAttrition)'的输出。请参阅[this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)和[this](https://stackoverflow.com/help/mcve) 。 –