由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 求助:SAS使用问题(读数据)
相关主题
请教个用SAS读数据的问题。[Help] Dividing a SAS data set
问一个简单的SAS问题,多谢新手请教sas 能画吗:散点图,有连线连接起来,并且有regression 线
请问关于交易量的一个SAS编程问题[合集] 求助,怎样在SAS里读数据的column name?
请教:回归方程中自变量的选取。关于读数据紧急求助,包子答谢,谢谢了先
回归方程里面的两个因素的相互作用SAS读数据乱码的问题
请教一个SAS问题[合集] passing-bablok and deming regression
请问如果用SAS 解决这个问题SAS Regression Macro 问题请教 (有包子)
question about longitudinal data新人报道,兼问SAS data set的问题
相关话题的讨论汇总
话题: sas话题: data话题: 140话题: proc话题: do
进入Statistics版参与讨论
1 (共1页)
r*******a
发帖数: 268
1
【 以下文字转载自 Mathematics 讨论区 】
发信人: risingsea (123), 信区: Mathematics
标 题: 求助:SAS使用问题(读数据)
发信站: BBS 未名空间站 (Thu Apr 9 13:28:37 2009), 转信
要用SAS做线性回归。比如说,现在有两个变量,Y和X,要用X表达Y。
现在X,Y都是140天的数据,每天有1500个公司给出数据。
所以有两个excel文件,140列,1500行。
我们要做的是对于每天,都给出相应的Y和X的回归方程。
然后我们实际上应该有140个方程。
现在最不知道怎么办的是怎么写SAS的语句,让它一次把这140次回归一下做完。。。。
问了统计系同学也没搞清楚。请大牛指点一下,如果写出全部语句比较麻烦,请指点一
下应该用什么思路或者什么函数之类的。。。
另外,还想问一下如何控制SAS输出结果的格式?因为我们还想对求出的140个回归方程
做分析。而SAS一般输出结果的格式显然不适合做进一步分析..
如果用其他统计软件方便做上面的操作,也请指教指教。
谢谢!:)
g*******y
发帖数: 380
2
not "Da niu", but a rookie for SAS.
If I understand your post correctly, you have two files:
Execl X:
Day1...........Day140
r*******a
发帖数: 268
3
呵呵非常感谢!
这个也是我一个朋友教我的!但是问题是excel文件列的长度是有限制的啊。好像是6万多
吧(excel 2003,因为SAS好像不支持excel 2007吧)。所以1500×140那就是3个六万。所
以最好得分成三个excel文件。
但是另外问题是我们要做的回归不仅仅是这一个,总共有6个变量的,而且还有好几个m
odel,不仅仅是Y=X。所以这样是很耗时的。而且就是分次做回归,不知道最后怎么把结
果输出成一个好的格式。因为我们最后要对这140个回归方程求平均,还有其他分析等等
。。
十分谢谢!

【在 g*******y 的大作中提到】
: not "Da niu", but a rookie for SAS.
: If I understand your post correctly, you have two files:
: Execl X:
: Day1...........Day140

q**j
发帖数: 10612
4
proc reg datat = yourdata outest = out;
by whatever;
model whatever;
run;
you can play with the "out" data set later.

万多
个m
把结
等等

【在 r*******a 的大作中提到】
: 呵呵非常感谢!
: 这个也是我一个朋友教我的!但是问题是excel文件列的长度是有限制的啊。好像是6万多
: 吧(excel 2003,因为SAS好像不支持excel 2007吧)。所以1500×140那就是3个六万。所
: 以最好得分成三个excel文件。
: 但是另外问题是我们要做的回归不仅仅是这一个,总共有6个变量的,而且还有好几个m
: odel,不仅仅是Y=X。所以这样是很耗时的。而且就是分次做回归,不知道最后怎么把结
: 果输出成一个好的格式。因为我们最后要对这140个回归方程求平均,还有其他分析等等
: 。。
: 十分谢谢!

r*******a
发帖数: 268
5
谢谢。这是调整输出格式的方法是吗?
谢谢

【在 q**j 的大作中提到】
: proc reg datat = yourdata outest = out;
: by whatever;
: model whatever;
: run;
: you can play with the "out" data set later.
:
: 万多
: 个m
: 把结
: 等等

q**j
发帖数: 10612
6
yes. you can save the output result into a sas data set and play with it wha
tever way you like in the future. if you have a lot of diferent models, you
might have to write a macro for that. not tricky at all.

【在 r*******a 的大作中提到】
: 谢谢。这是调整输出格式的方法是吗?
: 谢谢

g*******y
发帖数: 380
7
you can manipulate data in SAS, such as merge, transpose,not necessarily do
it in excel then import into SAS.

万多
个m
把结
等等

【在 r*******a 的大作中提到】
: 呵呵非常感谢!
: 这个也是我一个朋友教我的!但是问题是excel文件列的长度是有限制的啊。好像是6万多
: 吧(excel 2003,因为SAS好像不支持excel 2007吧)。所以1500×140那就是3个六万。所
: 以最好得分成三个excel文件。
: 但是另外问题是我们要做的回归不仅仅是这一个,总共有6个变量的,而且还有好几个m
: odel,不仅仅是Y=X。所以这样是很耗时的。而且就是分次做回归,不知道最后怎么把结
: 果输出成一个好的格式。因为我们最后要对这140个回归方程求平均,还有其他分析等等
: 。。
: 十分谢谢!

g*******y
发帖数: 380
8
What "Daniu" told u is how to do regression and output the results.
Suppose you want do 140 regressions by data, then you use "by day" in
precious code.
"out" is the name of output file which contains the results of regression.

【在 r*******a 的大作中提到】
: 谢谢。这是调整输出格式的方法是吗?
: 谢谢

r*******a
发帖数: 268
9
谢谢。那么在SAS里要进行那样的操作应该用什么方法呢?

do

【在 g*******y 的大作中提到】
: you can manipulate data in SAS, such as merge, transpose,not necessarily do
: it in excel then import into SAS.
:
: 万多
: 个m
: 把结
: 等等

g*******y
发帖数: 380
10
import you data into SAS.
put a another post tell "daniu" how much files you have in SAS, what do they
look like? What's the final data structure you want? Then they may write
explicit code for you, otherwise, they can only tell you generall methods,
you have to explore it by yourself.

【在 r*******a 的大作中提到】
: 谢谢。那么在SAS里要进行那样的操作应该用什么方法呢?
:
: do

g*******y
发帖数: 380
11

sorry, it's "regressions by day".
I forgot how to revise my post in telnet. :(

【在 g*******y 的大作中提到】
: What "Daniu" told u is how to do regression and output the results.
: Suppose you want do 140 regressions by data, then you use "by day" in
: precious code.
: "out" is the name of output file which contains the results of regression.

q**j
发帖数: 10612
12
no daniu, but you really need to do some homework yourself. it is not very n
ice to ask these questions w/o any effort made. at least you can read some s
as starter books.
1. to read data, first save data into .csv file and
proc import data = yourdata dlm=",";
run;
2. to merge:
proc sql or merge statement.
3. to transpose:
proc transpose.

they

【在 g*******y 的大作中提到】
: import you data into SAS.
: put a another post tell "daniu" how much files you have in SAS, what do they
: look like? What's the final data structure you want? Then they may write
: explicit code for you, otherwise, they can only tell you generall methods,
: you have to explore it by yourself.

c*********t
发帖数: 340
13
macro
里面包括proc reg XXX;
ods output ParameterEstimates=result1
然后merge 之前的result和新的Result1
最后输出成一个文件
我这几天也都在做类似的事情,反正这种思路是可行的~
1 (共1页)
进入Statistics版参与讨论
相关主题
新人报道,兼问SAS data set的问题回归方程里面的两个因素的相互作用
对应STATA的SAS CODE请教一个SAS问题
请教一个SAS文件循环生成的小问题请问如果用SAS 解决这个问题
请教SAS ODS to Excelquestion about longitudinal data
请教个用SAS读数据的问题。[Help] Dividing a SAS data set
问一个简单的SAS问题,多谢新手请教sas 能画吗:散点图,有连线连接起来,并且有regression 线
请问关于交易量的一个SAS编程问题[合集] 求助,怎样在SAS里读数据的column name?
请教:回归方程中自变量的选取。关于读数据紧急求助,包子答谢,谢谢了先
相关话题的讨论汇总
话题: sas话题: data话题: 140话题: proc话题: do