楼主: jackyzt1230
2155 3

SAS DO LOOP 语句 求助!!! [推广有奖]

  • 2关注
  • 1粉丝

硕士生

4%

还不是VIP/贵宾

-

威望
0
论坛币
586 个
通用积分
1.1898
学术水平
2 点
热心指数
2 点
信用等级
2 点
经验
2633 点
帖子
74
精华
0
在线时间
126 小时
注册时间
2012-3-6
最后登录
2021-1-4

楼主
jackyzt1230 发表于 2012-3-17 22:55:59 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Write in a program that reads in the coffee preference rating data below.  The data came from a marketing experiment in which male and female subjects were asked to taste one of the three different brands of coffee (A, B, and C) with each brand tasted twice, once at breakfast and once at dinner.  The preference ratings were scored on a scale of 1 to 10, 1 being the lowest rating.  Print out the data so that all the variables (subject, gender, brand, and ratings for each meal) are recorded.

Gender

Brand of Coffee

A

B

C

Subj

Breakfast

Dinner

Subj

Breakfast

Dinner

Subj

Breakfast

Dinner

Male

1

7

8

7

4

6

13

8

9

2

6

7

8

3

5

14

6

9

3

6

8

9

3

5

15

5

8

Female

4

5

7

10

3

4

16

6

9

5

4

7

11

4

4

17

6

9

6

4

6

12

2

3

18

7

8


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:loop Preference experiment breakfast Reference SAS

沙发
sl122113 发表于 2012-3-19 14:57:12
  1. data a;
  2. do brand=1 to 3;
  3. do sex=1 to 2;
  4. do id =1 to 3;
  5. subj+1;
  6. input breakfast dinner;
  7. output;
  8. end;
  9. end;
  10. end;
  11. cards;
  12. 7 8
  13. 6 7
  14. 6 8
  15. 5 7
  16. 4 7
  17. 4 6
  18. 4 6
  19. 3 5
  20. 3 5
  21. 3 4
  22. 4 4
  23. 2 3
  24. 8 9
  25. 6 9
  26. 5 8
  27. 6 9
  28. 6 9
  29. 7 8
  30. ;
  31. run;
  32. proc print data=a;
  33. run;
复制代码
Let Our Life Be Magic And Open

藤椅
baoaibaobao 发表于 2012-3-19 16:42:34
楼主难道是在do homework....

板凳
jinlin2009 发表于 2012-3-20 00:42:05
baoaibaobao 发表于 2012-3-19 16:42
楼主难道是在do homework....
真的很像homework,哈哈

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-3 09:36