由买买提看人间百态

topics

全部话题 - 话题: proc
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
d*******o
发帖数: 493
1
来自主题: Statistics版 - Proc SQL 大量数据匹配的效率问题
楼主的Query execution plan 应该是
Select <-- Nested loop <-- index scan on [information] table
<-- table lookup on [address] table
Cost 主要在table lookup上。
解决办法是把你的lookup table[address] normalize
For example:
Chicago 205.1.1.1
Chicago 205.1.1.2
….
把ip做primary key,然后做one-to-many merge
这时候也可以用proc format或hash tree
以后的Query execution plan 应该是
Select <-- Nested loop <-- index scan on [information] table
<-- index scan on [address] table
a******6
发帖数: 78
2
来自主题: Statistics版 - sas sql proc问题请教
*********************************************
proc sql;
create table ratio_anl as
select a.day, a.gel, a.cond as cond1, b.cond as cond2,
a.cond || ':' || b.cond as comp,
case b.cond when 'A' then 0.25
when 'B' then 0.5
when 'C' then 1
when 'D' then 1.5
when 'E' then 2
end as pr_ratio,
a.sas_avg as sas_avg1, a.sas_sd as sas_sd1,
b.sas_avg as sas_avg2, b.sas_sd as sas_sd2,
a.ratio, ( a.sas_sd**2 + (a.ratio*b.
t********y
发帖数: 469
3
来自主题: Statistics版 - proc surveyreg? 还是用 anova
比如说
sampling或者DOE 得到一组数据
有变量 y,x,class,s
y 和 x 都是continous variable
class和 s是 categorical variable
那么用proc surveyreg还是用anova?
来做这个model呢?
S******y
发帖数: 1123
4
来自主题: Statistics版 - Proc reg, weight, and predict
I have the following data set,and try to make predictions for the last two
records. PROC REG and weight are used to fit a linear model.
l***a
发帖数: 12410
5
assign %systime before and after each proc and get the difference?
y********i
发帖数: 205
6
我最近写了个如下的code,原来的code在definition部分有点问题,所以就把
definition的部分改了下。改之前t值的变化会影响结果的变化,但是我做了一点改动
之后,无论如何改动t值,结果都不变了,而且即使把t删掉,结果也不变。不知道是什
么原因?每次运行,log里都显示没有问题。但是如果把t值设置成0,结果会报错,不
知道有高人能指点下或大致判断下原因不?
proc iml;
/* Used for debugging only */
*reset log print details;
start COptimal(xx)
global (Weight, Var1, b0, b1, b2, t);
/* nrow(xx)=1, ncol(xx)=Nd*2 */
x=shape(xx,nrow(xx)*ncol(xx)/2,2);

F=j(nrow(x),1) || x[,1] || x[
x*******i
发帖数: 1590
7
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
我 run proc genmod, 有一个contrast statement
CONTRAST a*b 0 0 0 0 1 -1;
but in sas log
"WARNING: The contrast will not be tested due to some rows being
nonestimable."
output is
Contrast Results for GEE Analysis
Chi-
Contrast DF Square Pr > ChiSq Type
0 . . Score
不知道这个some rows being nonestimable是什么?有牛人帮个忙吧。
j*****e
发帖数: 182
8
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
Proc genmod;
class A B;
model outcome=A*B/noint;
contrast .....;
run;
This should work.
e****t
发帖数: 766
9
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
your A is continouse, right ? did you put it in the class statement ?
i think if with continouse variable in the model, "noint" option will effect
your contrast.
post your "proc genmod" code. let us check ....
x*******i
发帖数: 1590
10
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
my sas codes:
PROC genmod data=xx;
class provfs b;
model outcome=a b a*b;
repeated subject=provfs;
weight c;
CONTRAST 'test equal slopes'
a*b 1 -1 0 0 0 0,
a*b 0 1 -1 0 0 0,
a*b 0 0 1 -1 0 0,
a*b 0 0 0 1 -1 0,
a*b 0 0 0 0 1 -1;
run;
a is continuous. b is categorical with 6 groups,
thanks,

effect
j*****e
发帖数: 182
11
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
Try this.
PROC genmod data=xx;
class provfs b/param=ref ref=last;
model outcome=a b a*b;
repeated subject=provfs;
weight c;
CONTRAST 'test equal slope'
a*b 1 -1 0 0 0 ;
run;
For simultanous testing, just use the p-vale for the a*b term(5 df).
By the way, it seems like you don't understand the model parameterization.
x*******i
发帖数: 1590
12
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
各位,不好意思,确实不是统计专业出生却在做一些统计的活,不太懂一些名词。
有了问题,就到处google,然后依葫芦画瓢。
我是想test 6 interactions(b*a) coefficients 的不同。网上找到了这个:
http://www.ats.ucla.edu/stat/sas/faq/compreg3.htm
里面有一个sas codes
"PROC GLM DATA=htwt2 ;
CLASS age ;
MODEL weight = age height age*height / SOLUTION ;
CONTRAST 'test equal slopes' age*height 1 -1 0,
age*height 0 1 -1 ;
RUN;“
例子里是Ho: B1 = B2 = B3
我想test ho: B1 = B2 = B3=B4= B5 = B6,所以就模仿了他的contrast code.
这是一个contrast statement
CONTRAST 'test equa
j*****e
发帖数: 182
13
来自主题: Statistics版 - 有人知道这是什么回事?proc genmod.
First of all, you did not tell the whole story.
What kind of outcome do you have? What is the modeling distribution and what
is the link function here? By default, it is normal with identity link. Is
this what you want? If so, what not use proc mixed?
Second, what does weight=c means?
Third, you can write two class statements, one with provfs and one with b
using the options that I gave.
You have to understand the parameterization of linear models before you use
SAS. Otherwise, it will be a disa
p*****d
发帖数: 16
14
来自主题: Statistics版 - 请教PROC HAPLOTYPE有关问题
I guess it would be same SAS proc haplotype procedure except you specify EST
= BAYESIAN instead of using default EM algorithm.
h******e
发帖数: 1791
15
来自主题: Statistics版 - 再问proc mixed。
用proc mixed分析repeated measures,一个fixed effect的不同level的variance可以
在covariance matrix table里找到。然后,能不能估算两个不同level的variance的比
值的confidence interval?
p********r
发帖数: 1465
16
你直接 proc corr 就行
s********9
发帖数: 74
17
来自主题: Statistics版 - Proc mixed contrast
If I wanted to check the effect of A*B in proc mixed;
A: 1 2 3
B: 1 2 3 4
What could I do to make the group A=3 and B=4 as reference?
When I used estimate, there are lots of lines of A*B showed up as 0......
I want to try contrast statement, but it looks very confusion!
Anyone has experience?
e****t
发帖数: 766
18
SAS 9.2 gives a way for noninferioriy test for the difference of two
proprotions.
I try to use that, but confused where to specify the command.
Does anyone use it before ?
here is the link for introduction
http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_freq_sect010.htm#procstat.freq.binopts
i tried specify in "proc freq" "tables" "test" comond, none of them work.
can anybody like to share the code ?
Thanks in advance!
P****D
发帖数: 11146
19
proc freq;
table xxx / binomial(noninf);
run;
e****t
发帖数: 766
20
Thanks all. it works now!
I specify similiar in riskdiff (option) ;
proc freq data = a ;
table x * y / riskdiff (noninf margin = 0.05) ;
run;
e****t
发帖数: 766
21
sorry to bother again,
in the output, i didn't find p value.
Only CI is given. (i know i can invert it to get SE...lazy to do it ) can we
get non inferiority p value from SAS directly?
proc freq data = a ;
table x * y / riskdiff (noninf margin = 0.05 method = score) ;
run;
f****r
发帖数: 1140
22
来自主题: Statistics版 - 可以在proc sql中定义新的变量吗?
就像data step.要根据某些变量的combination定义新的变量。
if a in (2,3,4) and b in (3, 5,7) then new_var1="A" ;
if a in (1,7) and b in (2,6) then new_var2="B";
if a=6 then new_var3="C";
else new_var4="NA";
这个也可以用select when.
但是现在想在proc sql中用。a, b变量都已经sql table中选上了。怎么写呢?
多谢了。
f****r
发帖数: 1140
23
来自主题: Statistics版 - proc sql如何随机选择数据。ranuni
想随机从数据库里面pull一定数量的数据。就像data step里面的 where ranuni(123)=0.3 之类的。
看到网上有人用 在proc sql的 where ranuni(123) between 0.45 and 0.55 之类的。
但是为什么我用了log提示说是不对的function. 难道因为我的table太多?那个ranuni
只能用于一个table的时候?
另外,试过fetch,貌似fetch只能取前几个。而不是随机取多少。
望高手指教。多谢。
z***9
发帖数: 1052
24
来自主题: Statistics版 - 急问SAS proc gplot,在线等
有点图要在周末画出来给老板,家里电脑没有SAS,就临时装了一个过期的9.1.结果在
用proc gplot的时候,给我一个error:Procedure GPLOT not found.
为什么会这样的?难道因为过期了?我已经改了系统时间了。我这周末不可能去实验室
画的,哪位知道怎么解决这个问题。多谢多谢!!
a*****3
发帖数: 601
25
来自主题: Statistics版 - 急问SAS proc gplot,在线等
how about proc gchart?
d*******o
发帖数: 493
26
来自主题: Statistics版 - 急问SAS proc gplot,在线等
proc plot
n*****s
发帖数: 10232
27
来自主题: Statistics版 - help: proc logistic
试试score statement,然后再用proc score
k****w
发帖数: 26
28
来自主题: Statistics版 - help: proc logistic
在proc logistic前加上ods trace on;
log 里就有你要的各个statictics的名称,
把这个名称加到ods output 名称=dataset;
j*******9
发帖数: 27
29
来自主题: Statistics版 - proc mix在生统中的应用
proc mix 是测试random var 和 fix var 组合起来的关系,生统上mix model用得比
glm多~ 可以google一下:)
S******y
发帖数: 1123
30
SAS/PROC SQL vs. SQL
SAS/SQL follows most of the guidelines set by American National Standards
Institute(ANSI) in its implementation of SQL. However it is not fully
compliant with the current ANSI Standard for SQL.
For more : see - SAS Guide to the SQL Procedure, esp. Appendix 2 - SQL
procedure and the ANSI Standard for SQL
p*****o
发帖数: 543
31
来自主题: Statistics版 - question in proc sql
I'm wondering how can i make the following code work?
PROC SQL;
CREATE TABLE A AS
SELECT MAX(DAYS) AS MAX_DAYS, ID
FROM B
GROUP BY ID
ORDER BY ID
WHERE (CALCULATED MAX_DAYS) >= 10;
QUIT;
it always said there is some error on the 'where' usage there.
Can anyone explain to me how to work it out?
Thanks a lot
s******r
发帖数: 1524
32
来自主题: Statistics版 - question in proc sql
PROC SQL;
CREATE TABLE A AS
SELECT MAX(DAYS) AS MAX_DAYS, ID
FROM B
GROUP BY ID
having (MAX(DAYS)) >= 10
ORDER BY ID
;
QUIT;run;
k**g
发帖数: 1558
33
归根到底,就是怎么样使proc sql的join 更快?我知道在SQL server里面可以对一个
数据表进行index,这样join就很快。SAS里面能做到吗?谢谢!
p********a
发帖数: 5352
34
proc sql;
create index xxx
k**g
发帖数: 1558
35
Thanks! If I have two existing tables, is this correct?
Proc SQL;
Create index Table1 date;
Create index Table2 date;
Create Table Table3 As
Select a.*, b.*
From Table1 a
Join Table2 b
On a.date=b.date;
p********a
发帖数: 5352
36
你这个连语法都不对吧?写出来前肯定没GOOGLE过。
请GOOGLE PROC SQL CREATE INDEX
后面那个JOIN语法也不对
d*******1
发帖数: 854
37
来自主题: Statistics版 - 求助,SAS proc mixed
Proc mixed
class gender nationality;
model salary = gender nationality gender*nationality/solution;
run;
t****n
发帖数: 1879
38
来自主题: Statistics版 - SAS 数据读入的问题 (proc import)
code:
proc import out = work.n3
datafile="c:\n3.xls"
dbms=excel replace;
range="sheet1$";
getnames=YES;
MIXED=NO;
scantext=YES;
usedata=yes;
scantime=yes;
run;
t*********l
发帖数: 778
39
来自主题: Statistics版 - proc iml help!
proc iml;
x = j(100,100,0);
do i = 1 to 100;
do j=1 to 100;
x[i,j] = n_&i._&j;
end;
end;
quit;
为什么这个不work呢?
t*********l
发帖数: 778
40
来自主题: Statistics版 - proc iml help!
STILL NOT WOKRING!! n_i_j is macro variables i=1-3 j=1-3
proc iml;
x = j(3,3,0);
%macro call;
%do i = 1 %to 3;
%do j=1 %to 3;
x[i,j] = &&n_&i._&j;
%end;
%end;
%mend;
%call;
quit;
s******r
发帖数: 1524
41
I tried cat(of c1-c2) in proc sql and failed. While I tried try
cat(c1,c2), there is no problem.
Any clue?
Thanks,
o****o
发帖数: 8077
42
这个SAS-L上前两个星期有人问过,不过是SUM函数
VAR1-VARk的表达方式是SAS自己的,似乎跟SQL标准不兼容;所以SAS就没有implement
比如说这个QUERY怎么用VAR1-VARk的方式?
proc sql;
create table x as
select a.id, a.datetime, sum(a.val1, b.val2) as val
from y as a, y as b
where a.id=b.id & a.datetime ;
quit;
w*******n
发帖数: 469
43
like I want to input
proc format;
value A
1="µL"
;
run;
If I directly copy µ from word to my code, the outcome will be "A&
micro;", not "µ",
Can any big bull give me the answer?
Thanks with BaoZhi if with correct answer.
p********r
发帖数: 1465
44
我是想这样做:
1、有一个叫table的数据,我随机把他分成两个,table1和table2(table1包含80%
table的数据,table2包含剩余的20%)
2、用table2做一些运算,用proc iml,然后把运算结果输出到result里面。
我想把这个两个步骤循环做1000遍,这样我的result表里面就会出来1000个结果。
请问应该如何做会比较好?
t**********h
发帖数: 100
45
我用output out=a,比如:
proc means data = test n mean median mode;
var x;
output out=a;
run;
我要的是n mean median mode, 但是文件a里面却还是 n, min, max, mean, std.
怎样才能生产我想要的statistics? 如 median, mode.
多谢了。
y****n
发帖数: 46
46
proc means data = test ;
var x;
output out=a(drop=_type_ _freq_) n=n mean=mean median=median mode=mode;
run;
s*******2
发帖数: 791
47
proc means data=test noprint;
output out = summary(drop = _:)
mean(var1 var2) =
n(var1) =
median(var1 var3) =
mode(var1 var5) / autoname;
run;
s******y
发帖数: 352
48
来自主题: Statistics版 - sas proc report的问题。
proc report data=test nowd;
column b=b1 a b=b2 c;
define b1/order noprint;
define a/order;
define b2/order;
define c/display;
run;
Baozi please!
w*******n
发帖数: 469
49
来自主题: Statistics版 - sas proc report的问题。
proc print;
by a b;
id a b;
var c;
run;
h******e
发帖数: 1791
50
来自主题: Statistics版 - sas proc report的问题。
谢谢,不过我需要proc report。
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)