楼主: qt600
3471 9

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

  • 0关注
  • 1粉丝

已卖:2704份资源

本科生

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 |AI写论文

+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?

7
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   查看全部评分

8
shgch 发表于 2007-3-27 09:30:00

该给fangtmrx奖励

9
qt600 发表于 2007-3-27 18:19:00

受教了。多谢。

10
weihancool 发表于 2007-3-30 13:38:00

谢谢

国士无双

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 22:21