由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - [sas] 怎么用自定义format里的值来计算?
相关主题
what is the fastest way of look-up in SAS?sas help!!
如果不满足normality的假设,还能用proc glm吗?SAS proc format的问题
sas base online tutor 可以跳着看么?SAS里关于recode一问
SAS format 的问题一个很疑惑的SAS日期问题
y = a + b * (c ^ x)Proc SQL 能不能直接读 非 SAS format 的数据,txt , csv 等
一般什么样的数据,分析起来要做log transformation?一个proc format的问题
support vector machineHelp needed on SAS proc report
what is statistic scoreSAS - please help!
相关话题的讨论汇总
话题: format话题: proc话题: data话题: 自定义话题: 计算
进入Statistics版参与讨论
1 (共1页)
A*******s
发帖数: 3942
1
google了一下,没找到答案。
问题是这样的,假如我有自定义的format如下
proc format;
value aaa 1=2
2=4
;
run;
那么我想根据format的值,而不是原来的值,来计算一个data set的basic statistics
, 怎么办?sas的proc有没有统一的option是干这个的?
我用proc里的format statement,计算的还是原来的值。
比如说对于数据(1,2)来说,其mean应该是1.5,
但是我想用format后的数据(2,4)来算,mean该是3.
我把问题说明白没?谢谢大家。
s******y
发帖数: 352
2
if you understand the definition of FORMAT, you will know it is impossible.
but if you create a new variable with input/Put transformations, the
statistic based upon the new var is what you need.
A*******s
发帖数: 3942
3
damn, what if I have thousands of variables? I hate writing macros...
I was thinking using proc print with ods output to get the data after
normalization/transformation. It turns out that proc print doesn't support
ods...
so what is the FASTEST way to do data normalization/transformation?

impossible.

【在 s******y 的大作中提到】
: if you understand the definition of FORMAT, you will know it is impossible.
: but if you create a new variable with input/Put transformations, the
: statistic based upon the new var is what you need.

s******y
发帖数: 352
4
not entirely understand what you are trying to accomplish. but you don't
have to resort the macro, especially as you hate it so much.
alternatively, you can dynamically write statement to a temp file, then
later included with %inc. it is all data-driven.
something like this you could give it a try.
filename temp temp;
data _null_;
set yourvar; *<<-----this is a dataset contains all the variables (name &
format) need
transformation. you can get it from sashelp.vcolumns or
diction
l***a
发帖数: 12410
5
use put function

statistics

【在 A*******s 的大作中提到】
: google了一下,没找到答案。
: 问题是这样的,假如我有自定义的format如下
: proc format;
: value aaa 1=2
: 2=4
: ;
: run;
: 那么我想根据format的值,而不是原来的值,来计算一个data set的basic statistics
: , 怎么办?sas的proc有没有统一的option是干这个的?
: 我用proc里的format statement,计算的还是原来的值。

l*********s
发帖数: 5409
6
create a new variable using put and input function

【在 A*******s 的大作中提到】
: damn, what if I have thousands of variables? I hate writing macros...
: I was thinking using proc print with ods output to get the data after
: normalization/transformation. It turns out that proc print doesn't support
: ods...
: so what is the FASTEST way to do data normalization/transformation?
:
: impossible.

A*******s
发帖数: 3942
7
Thanks guys. Finally I use input and put functions with arrays in data step
to transform data.
The only way I found to directly use "formatted value" is when "formatted
variable" is treated as categorical. E.g, proc freq with format statement. I
have yet found a way to deal with continuous "formatted variable". If
someone has a clue, plz share your experience.
1 (共1页)
进入Statistics版参与讨论
相关主题
SAS - please help!y = a + b * (c ^ x)
[合集] help - sas proc sql with do loop一般什么样的数据,分析起来要做log transformation?
What is R equivalent to SAS format?support vector machine
请问proc reportwhat is statistic score
what is the fastest way of look-up in SAS?sas help!!
如果不满足normality的假设,还能用proc glm吗?SAS proc format的问题
sas base online tutor 可以跳着看么?SAS里关于recode一问
SAS format 的问题一个很疑惑的SAS日期问题
相关话题的讨论汇总
话题: format话题: proc话题: data话题: 自定义话题: 计算