请选择 进入手机版 | 继续访问电脑版
楼主: qt600
3084 9

[求助] Two Base SAS test points [推广有奖]

  • 0关注
  • 1粉丝

本科生

83%

还不是VIP/贵宾

-

威望
0
论坛币
5641 个
通用积分
0.9701
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1143 点
帖子
98
精华
0
在线时间
77 小时
注册时间
2007-2-25
最后登录
2023-9-11

qt600 发表于 2007-3-26 02:29:00 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

1.concatenating operator:

eg: data1= 'FA';

data2='1';

data3=data1|| data2;

run;

the value of data3 is FA only.why?

2.As we known, ddmmyy8. or ddmmyy10. are common to use.

Can you write yymmdd10. if the raw data is given 1960/01/01?

Thank you guys.

二维码

扫码加我 拉你入群

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

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

关键词:Points Point Base test Est test SAS Base Points two

回帖推荐

fangtmrx 发表于7楼  查看完整内容

Q1: you have made the questions different between the first time and the second. first you have 3 variables, second time you have two variables. using proc contents to check what happened to your data.if you change jobCategory= JobCategory || JobLevel; to job= JobCategory || JobLevel, then using proc contents, you will find out the job is defined for 3 chars long. Q3( if question): ...

fangtmrx 发表于4楼  查看完整内容

Q1: I get data3=FA1. i don't know what had happen to you. Q2: yes, you can.you can read data into sas by using informat. when you want to print, you can use any data format to display. Q3: form my understanding, the whole obs will be missing from the output data set. Q4: data work.passengers; if OrigPassengers = . then OrigPassengers=100; % here OrigPassengers=100 TransPassengers= 100; ...

本帖被以下文库推荐

qt600 发表于 2007-3-26 03:00:00 |显示全部楼层 |坛友微信交流群

One more question about IF Statement.

IF Statement restricts the obs into the output data file only.

eg, one obs contains several variables.The whole obs will be removed or not if one of variables does not match IF statement.

Or the obs is still be read while the specific variable is read as missing value?

Hope everyone can understand what I am talking about.

使用道具

qt600 发表于 2007-3-26 09:41:00 |显示全部楼层 |坛友微信交流群

最后一问。

data work.passengers;

if OrigPassengers = . then

OrigPassengers=100;

TransPassengers= 100;

OrigPassengers= .;

NonPaying= 10;


TotalPassengers= sum (OrigPassengers, TransPassengers);

答案是100。正确的读取顺序应该是怎么样的呀? 谢谢。

使用道具

fangtmrx 发表于 2007-3-26 14:01:00 |显示全部楼层 |坛友微信交流群

Q1: I get data3=FA1. i don't know what had happen to you.

Q2: yes, you can.you can read data into sas by using informat. when you want to print, you can use any data format to display.

Q3: form my understanding, the whole obs will be missing from the output data set.

Q4:

data work.passengers;

if OrigPassengers = . then OrigPassengers=100; % here OrigPassengers=100

TransPassengers= 100; %TransPassengers= 100;

OrigPassengers= .; $OrigPassengers= .;

NonPaying= 10;


TotalPassengers= sum (OrigPassengers, TransPassengers); %so the total is .+100 = 100

已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 10 精彩帖子

总评分: 经验 + 3  论坛币 + 10   查看全部评分

使用道具

qt600 发表于 2007-3-27 01:32:00 |显示全部楼层 |坛友微信交流群

Q1.

The following SAS program is submitted:

data work.staff;

JobCategory= 'FA';

JobLevel= '1';

jobCategory= JobCategory || JobLevel;

run;

Which one of the following is the value of the variable JOBCATEGORY in the

output data set?

A. FA

B. FA1

C. FA 1

D. ' ' (missing character value)

Answer : A

使用道具

qt600 发表于 2007-3-27 01:45:00 |显示全部楼层 |坛友微信交流群

For IF Statement:

A raw data file is listed below:

----|----10---|----20---|----30

John McCloskey 35 71

June Rosesette 10 43

TinekeJones 9 37

The following SAS program is submitted using the raw data file as input:

data work.homework;

infile 'file-specification';

input name $ age height;

if age LE 10;

run;

How many observations will the WORK.HOMEWORK data set contain?

A. 0

B. 2

C. 3

D. No data set is created as the program fails to execute due to errors

Answer: C

if the whole obs will be removed from the output dat file if the condition doesnt match IF Statement, how answer is 3 obs?

使用道具

fangtmrx 发表于 2007-3-27 02:45:00 |显示全部楼层 |坛友微信交流群

Q1: you have made the questions different between the first time and the second.

first you have 3 variables, second time you have two variables.

using proc contents to check what happened to your data.if you change

jobCategory= JobCategory || JobLevel; to job= JobCategory || JobLevel, then using proc contents, you will find out the job is defined for 3 chars long.

Q3( if question): the problem is not if statement, it is the name varaible. the first two names with space in it. sas read John as name,read McCloskey as age, but it is char, so age is missing in the first obs. the second record is the same. the third record will read only 8 letters for name because it is the SAS allowed.

if you change all names within 8 and without space, you will have 2 records.

To slove this problem, you have to learn how to input data which you could get it from sas base material.

已有 1 人评分论坛币 收起 理由
bakoll + 10 精彩帖子

总评分: 论坛币 + 10   查看全部评分

使用道具

shgch 发表于 2007-3-27 09:30:00 |显示全部楼层 |坛友微信交流群

该给fangtmrx奖励

使用道具

qt600 发表于 2007-3-27 18:19:00 |显示全部楼层 |坛友微信交流群

受教了。多谢。

使用道具

weihancool 发表于 2007-3-30 13:38:00 |显示全部楼层 |坛友微信交流群

谢谢

国士无双

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-18 20:29