由买买提看人间百态

topics

全部话题 - 话题: var1
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)
a********i
发帖数: 205
1
来自主题: Statistics版 - 问个 sas 也许很简单的问题
那就是substr(var1,1,4)=""
然后再left(trim(var1))这样不知道行不行
h********o
发帖数: 103
2
来自主题: Statistics版 - 请教大家 这个SAS小程序怎么编
DATA ONE;
INPUT VAR $ @@;
CARDS;
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14
;
DATA ONE;
SET ONE;
RETAIN ID ;
IF MOD(_N_, 5) = 1 THEN ID + 1;
RUN;
PROC TRANSPOSE DATA = ONE OUT = TWO (DROP = _NAME_ ID
RENAME = (COL1 = VAR1
COL2 = VAR2
COL3 = VAR3
COL4 = VAR4
C... 阅读全帖
x******n
发帖数: 92
3
来自主题: Statistics版 - SAS question
Sorry can not type Chinese
Suppose we have two tables
Table one:
ID Var1 Var2 Var3.....Var30
1 1 0 0 1
2 0 1 1 0
.
.
.
100 1 1 1 1
Table two:
Var Type
Var1 1
Var2 2
Var3 3
.
.
.
Var30 1
We want to pick out the data in table one that Var type is 1
How to do that using SAS
e*******e
发帖数: 75
4
来自主题: Statistics版 - SAS question (紧急求助,在线等)
I have a series of variables, var1-var99, all of them are character
variables, want to create a new variable var_sum=1 if any of the var1-
var99='certain value', otherwise var_sum=0.
I am not sure which SAS function can be used? Many thanks!
e*******e
发帖数: 75
5
来自主题: Statistics版 - SAS question(ergent)
Hi,
I have a SAS question as follows:
I have a data set A with variable var1-var50;
and I need to create a new variable newvar=1 if all the var1-var50 equal to
missing.
How can I create the newvar? Thanks,
Y******Y
发帖数: 8753
6
来自主题: Statistics版 - 问个censored的survival data概念
censored是没有死或者不知道生死(lost to follow up).
syntax怎么写取决于你怎么define你的censor indicator(假设你叫他ind)
如果你的coding是 ind= 1( if dead), ind=0( if censored)
那syntax就是 model time*ind(0)=var1 var2
如果你的coding是 ind= 0( if dead), ind=1( if censored)
那syntax就是 model time*ind(1)=var1 var2
l****u
发帖数: 529
7
来自主题: Statistics版 - 一个SAS的时间区域求值问题
try this one, maybe it works
data new;
input @1 startdate date9. @11 stopdate date9.;
cards;
29Mar2007 02Apr2007
15Apr2007 20Apr2007
15Mar2007 18Mar2007
30Mar2007 31Mar2007
18Apr2007 21Apr2007
25Mar2007 30Mar2007
;
run;
proc sql;
select startdate into:var1 separated by' ' from new;
select stopdate into:var2 separated by' 'from new;
select count(*) into: num from new;
quit;
%let total=%eval(&num.*&num);
data new1;
array start [ &num.] (&var1.);
array stop [ &num.] (&var2.);
array ... 阅读全帖
l***o
发帖数: 5337
8
来自主题: Statistics版 - 双包子求教:SAS问题
一个data set, 结构很简单:
rowid, var1, var2, ... var100.
我现在就对var1-var100 的一种值(‘A')感兴趣,希望查一查 ’A'的位置都在哪儿。
所以想搞个output data set,只有两行:
rowid, location
比如说, 第一行的 var19, var77的值是‘A', 那输出set中就应该有两行:
rowid location
1 19
1 77
请问这个怎么写才好?谢谢!
l*********s
发帖数: 5409
9
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
having baozi bu?
data result;
length name $8;
set A;
array aa{*} var1-var4;
do i=1 to dim(aa);
if aa{i}=max(of var1-var4) then name=vname(comp{i});
end;
drop i;
run;
a*****3
发帖数: 601
10
来自主题: Statistics版 - ask for help (urgent): A SAS question
proc means data =bbb noprint;
class patid ;
var var1-var200;
output out = maxout(drop= _:) max= var1-var200/noinherit missing ;
要是能行 赏个包子暖暖手?
g****8
发帖数: 2828
11
来自主题: Statistics版 - ask for help (urgent): A SAS question
nice. but should no 'missing' there. And a 'Nway'
proc means data =test noprint nway;
class patid ;
var var1-var200;
output out = maxout(drop= _:) max= var1-var200/noinherit ;
run;
z*********i
发帖数: 146
12
来自主题: Statistics版 - 请教关于SAS表格输出的问题
我想输出一个表格
格式如下:
######## VAR1 VAR2 VAR3
######## FREQ % FREQ % FREQ %
FEMALE# 940 49.8 141,84 52.5 57,308 42.2
MALE### 947 50.2 12,844 47.5 78,599 57.8
TOTAL## 1,866 100 27,027 100 135,906 100
VAR1 VAR2 是CHAR , VAR3 是NUM
g****8
发帖数: 2828
13
来自主题: Statistics版 - 请教关于SAS表格输出的问题
我是问你都有什么样子的var,你给的那个例子,我怎么觉得不对。
如果是freq的,为什么var1 跟var2的total不一样。
比如说是不是你有var1 var2 var3 gender,对gender做表格?
z**********i
发帖数: 88
14
I am trying to run linear regression with the factor as the dependent
variable. This factor was obtained from factor analysis.
________________________________________________________________________
1. There are 10 variables var1 through var10, each variable has 7 categories
. Below is the format:
1="Disagree very much"
2="Disagree"
3="Somewhat disagree"
4="Neutral"
5="Somewhat agree"
6="Agree"
7="Agree very much";
These 10 variables are highly correlated.
2. Factor analysis comes up with 3 fac... 阅读全帖
s******1
发帖数: 178
15
来自主题: Statistics版 - SAS help
I have a data set1
var1 var2 var3
1 . .
2 . .
. 3 .
. 4 .
. . 5
. . 6
and want to get data set2
var1 var2 var3
1 3 5
2 4 6
what kind of sas code I can use?
Thank you very much!
k*******a
发帖数: 772
16
来自主题: Statistics版 - SAS help
这个看你怎么定义合并的方法了, 可以试试下面的看看
data test1;
merge test(keep=var1 where=(var1 ne .))
test(keep=var2 where=(var2 ne .))
test(keep=var3 where=(var3 ne .))
;
run;
t********m
发帖数: 939
17
if var1 in ('x','y','z') or var2 in ('x','y','z') or var3 in ('x','y','z
') or var4 in ('x','y','z') then target=1; else target=0;
就是只要var1-var4里面任何一个变量含有x或y或z,目标变量就等于1,否则为0。
上述程序很繁琐,能不能用array来优化一下啊?多谢指教!
t*******t
发帖数: 633
18
这个可以啵?
data test;
input var1 $ var2 $ var3 $ var4 $ var5;
cards;
x 8 2 1 4
3 4 5 21 2
0 z 88 45 2
;
run;
data test2;
set test;
array var{4} var1-var4;
do i=1 to 4;
if var{i} in ('x','y','z') then target=1;
end;
if missing(target) then target=0;
run;
s******r
发帖数: 1524
19
if var1 in ('x','y','z') or var2 in ('x','y','z') or var3 in ('x','y','z
') or var4 in ('x','y','z')
does not mean var1-var4 is one-letter variable. It could be
'xag','x','yz'.
So only the second one meets LZ's requirement.
k*******a
发帖数: 772
20
来自主题: Statistics版 - 请教flag问题
data test;
input var1 $ var2 $;
datalines;
A no
A no
B yes
B no
B missing
C yes
C yes
C no
C missing
;
proc sql;
create table test1 as
select a.*, sum(var2="yes")>0 as flag
from test a
group by var1;
quit;
w*******n
发帖数: 469
21
来自主题: Statistics版 - Help for co-linear question
given corr=0.4 (p<0.05) of var1 and var2, and outcome=pre/post, how to check
the co-linear of var1 and var2?
Thanks a lot for the help.
w****s
发帖数: 4430
22
来自主题: Statistics版 - SAS question
I have a list of character values seperated by a blank.
var1 = "" "a" ""
then I used %let k = %scan(var1, 1, ' ') to read the value one by one, but
this does work. If I remove the first empty string, scan works.
Can you tell me what happened. Thank you very much for your help
b********r
发帖数: 764
23
来自主题: Statistics版 - 请教一个简单SAS问题
比如你的5个variable是var1,var2,。。,V5吧
data outdsn;
set indsn1(rename=(var1=new))
indsn2(rename=(var2=new))
indsn3(rename=(var3=new))
indsn4(rename=(var4=new))
indsn5(rename=(var5=new));
run;
s******8
发帖数: 102
24
来自主题: Statistics版 - 请教一个简单SAS问题
data outds;
set yourds;
array v(5) var1-var5;
do I=1 to 5;
newvar=var(I);
output;
end;
drop var1-var5 I;
run;
c**d
发帖数: 104
25
来自主题: Statistics版 - 包子问题请教( sas)
in the model: y = var1|var2|var3|var4 @2 /stepwise;
give you all 2-way interactions.
1. using proc contents output the variable name data
2: using proc sql to create a macro variable to paste your variables to be
var1|var2|var3|var4|.....
3: in the model y = &varlist. @2 /stepwise;
q**********9
发帖数: 711
26
来自主题: Statistics版 - 包子问题请教( sas)
proc glm 可以用 model y = var1|var2|var3|var4 @2;
但是option 里没有stepwise选项,
proc reg 有stepwise 选项,但是不能用 model y = var1|var2|var3|var4 @2这个命令,
我的sas 里没有proc glmselect 命令,现在该用哪个 proc 命令呢?
x***6
发帖数: 15
27
来自主题: Statistics版 - 编程菜鸟问一个sas编程问题
版上牛人多,问一个处理data的问题。
data中的subject,如果满足3个条件中的一个就可以。
1。var1 等于8个数值中的一个,
2。var1 介于一个范围也可以,
3。var2-9 等于3个值中一个也可以。
这个该怎么编?我想的是分别弄出符合条件的3个data,然后合并。
还是一个能处理完?
多谢了!
w*******9
发帖数: 1433
28
来自主题: Statistics版 - 编程菜鸟问一个sas编程问题
The code could be shorter:
data new;
set old;
indx = 0;
if var1 in (8个数字)or var1 between a and b then indx=1;
do i=2 to 9;
if vvaluex(compress("var"||i)) in (3 个数字)then indx=1;
end;
run;
Then just select those obs with indx=1.
S*******1
发帖数: 251
29
来自主题: Statistics版 - help!! help!! SAS help!! Urgent!!
Then you need sort the data out with nodupkey to remove the duplicated Var1
and var2. then used the same idea to count the level of var3 under the group
of var1 and var 2.
d*****o
发帖数: 6
30
来自主题: Statistics版 - 求大牛解答 SQL 问题
小女工作中碰到一个SQL问题。。由于现在还是个SQL 菜鸟,对此问题很是挠头。。
举例
id var1 var2 var3
1 A B B
1 B C B
1 A B C
2 A A B
2 A A B
2 C C B
3 C A A
3 B A A
3 A A A
如果要写一个logic选择每个id只keep一个,条件是优先选有c的,其次是b.最后是a.
还有一点是先看var3再看var2,最后是var1
象id=1.var3里面优先选c所以要keep这个obs,其他delete
id=2,var3里面都相同,所以看var2,只有A和B情况下优先选B,所以就keep第一个
record
以此类推。。。
这个code在SQL上如何实现呢?或者在SAS可以实现的话也可以。
F****3
发帖数: 1504
31
来自主题: Statistics版 - DATA step能left join吗?
我用SQL是这样搞的:
proc sql;
create table WANT as
select distinct a.*, b.VAR1 , b.VAR2
from HAVE1 as a left join HAVE2 (DROP=link_count) as b
on a.PATIENT_ID = b.PATIENT_ID and a.YEAR = b.YEAR;
quit;
但是应为硬盘容量有限,所以只能用DATA STEP了。请问出来的WANTtable是不是一模一
样的啊?
proc sort data=HAVE1;
by PATIENT_ID YEAR;
run;
proc sort data=HAVE2(keep=PATIENT_ID YEAR VAR1 VAR2);
by PATIENT_ID YEAR;
run;
data WANT;
merge HAVE1 (in=a) HAVE2(in=b);
by PATIENT_ID YEAR;
if a;
run;
t*****w
发帖数: 254
32
来自主题: Statistics版 - 问个 SAS转换数据的问题!
data test;
infile "C:Users.....temp.txt" dlm=",";
input x1$ ;
input x2 x3 x4 ;
run;
data test2;
set test;
var1=substr(x1, 1,1);
var2=substr(x1, 2);
run;
proc sql;
create table test3 as
select var1, var2, x2, x3, x4
from test2;
quit;
s*********e
发帖数: 1051
33
来自主题: Statistics版 - Please help with a SAS macro
data one (drop = var2);
input Month Var1 Var2;
datalines;
201401 2 2.00
201402 4 3.00
201403 5 3.67
201404 8 4.75
201405 10 5.80
201406 12 6.83
201407 21 8.86
;
run;
proc sql;
create table two as
select b_month, mean(a_var1) as var2
from
(select
a.month as a_month,
b.month as b_month,
a.var1 as a_var1
from one as a, one as b where a.month <= b.month)
group by b_month;
quit;
proc print data =two;
run;
a**w
发帖数: 60
34
proc sql里可以实现, 但是code 显得太笨:
proc sql;
create table a as
select *,
sum(P1) as sum_P1,
sum(P2) as sum_P2,
sum(P3) as sum_P3,
sum(P4) as sum_P4,
.
.
.
sum(P98) as sum_98,
sum(P99) as sum_99,
sum(P100) as sum_100,
sum(Q) as sum_Q,
calculated sum_P1/calculated sum_Q as F1,
calculated sum_P2/calculated sum_Q as F2,
calculated sum_P3/calculated sum_Q as F3,
calculated sum_P4/calculated sum_Q as F4,
.
.
.
calculated sum_P98/calculated sum_Q as F98,
calculated sum_P99/calculated sum_Q as F99,
calculated... 阅读全帖
y**3
发帖数: 267
35
来自主题: Statistics版 - sas coding help needed
help needed from sas expert!
I have 2 variables in my sas data set-var1 var2. var2 only has value at the
first record.i need to compute the rest of var2 based on the ratios of two
records next to each other; for ex;
the 2nd row ; var22=(95/87)*85; then compute var23 based on the new number
and var12 and var13.
how to code this in sas efficiently? thanks
var1 var2
87 95
85
78
75
65
56
34
y**3
发帖数: 267
36
来自主题: DataSciences版 - SAS coding help needed
help needed from sas expert!
I have 2 variables in my sas data set-var1 var2. var2 only has value at the
first record.i need to compute the rest of var2 based on the ratios of two
records next to each other; for ex;
the 2nd row ; var22=(95/87)*85; then compute var23 based on the new number
and var12 and var13.
how to code this in sas efficiently? thanks
var1 var2
87 95
85
78
75
65
56
34
A*****s
发帖数: 813
37
来自主题: ChinaStock版 - 指标举例:杀庄武器
☆杀庄武器☆:可用于分析家.大智慧L2.
该指标:趋势.买卖点清晰
A01:=DYNAINFO(7);
A03:=BARSCOUNT(CLOSE);
A04:=(SMA((CLOSE / HHV(HIGH,120)),3,1) * 100);
A05:=IF((A03 > 20),A04,0);
A06:=IF((LOW > A01),0,IF((HIGH < A01),1,(((A01 - LOW) + 0.009) / ((HIGH -
LOW) + 0.009))));
A07:=DMA(A06,(VOL / CAPITAL)) * 60;
A09:=IF((((A07 > 0) AND (A07 > REF(A07,1))) AND (A05 <= 88)),A07,0);
Var1:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(
SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
Var2:=EMA(Var
A*****s
发帖数: 813
38
来自主题: ChinaStock版 - 指标2:夺宝奇兵
希望大家能多一些指标制作的讨论
来源:MACD论坛 作者:林夕
主图指标,在大智慧里勾选主图叠加,否则字看不清楚
使用:白K买入。黄K加仓。绿K出局。笑脸买入。黄点出局。X3线向下不可买入,或以
抢反弹思路操做。m,K,R顶底提示背离状态。不做为操作主要依据。买入。卖出应结合
均线法则综合研判。粘合后向上发散为最佳。该指标缺少量元素。应配合成交量综合观
察。寻求多要素共振。
Var1:=EMA(C,3);
Var2:=EMA(C,5);
Var3:=EMA(C,10);
Var4:=EMA(C,20);
Var5:=EMA(C,30);
Var6:=(Var2+Var3+Var4+Var5)/4;
Var7:=(Var6-REF(Var6,15))/REF(Var6,15)*100;
Var8:=(Var6-REF(Var6,15))/REF(Var6, 15)*100;
Var9:=EMA(Var7,8);
STICKLINE(Var7<1*REF(Var7,1),h,l,0.5,0),COLORBLUE;{蓝-持币}
STICKLINE(Var7<1*REF(Var7,1),o,c
a**********s
发帖数: 588
39
int main()
{
Derived *Var = new Derived();
>>>> 这个语句, 分别调用基类和派生类的构造函数, 于是
>>>> Constructor: Base //1
>>>> Constructor: Derived //2
Base Var2;
>>>> 这个语句, 调用基类构造函数, 于是
>>>> Constructor: Base //3
Var2 = (Base) *Var;
>>>> 这个语句有一丝丝复杂, 等号右边产生一个临时Base类型的变量,
>>>> 调用Base类的"拷贝构造函数" Base(const Base&), 但是
>>>> 这个你没有定义, 所以什么都没有打印出来
>>>> 临时变量消灭的时候, 调用析构函数, 于是:
Destructor : Base //4
delete Var;
>>>> 这个比较简单
>>>> Destructor : Derived //5
>>>> Destructor : Base //6
return 0;
>>>> 这个也比较简单, 因为Var1的生命周期随着函数的返回结束
>>>
a********m
发帖数: 15480
40
来自主题: JobHunting版 - 问两道笔试题
for(...) a[i] = var1 + var2 - a[i];
h****n
发帖数: 596
41
默认版规,
non-cc-paypal 请不要在paypal中留任何信息,站内pm就好
如果有要求,我会尽全力提供细节照片,也请买家确定好,再购买以防比不要的误会。
邮寄方式,暂定10.2快的priority吧,如果想买的mm有意见可以再商量。
保险根据买家mm的要求,you choose you pay.
不负责邮寄损失,不退不换
CARMEN MARC VALVO Taupe Tiered Lace Cocktail Dress ,nwt
Size: 6
真的好心痛。。。非常非常喜欢,可惜我穿大了,rulala又一次final sale来的,原价
600好像,151.6到手,还这个价不包邮转。按说我应该有rulala的receipt,又需要的
话我找找,但不一定能找到,因为当时一试大了就想转,就把receipt藏好了,可是太
喜欢了,就一直没舍得转。。。还是转给能穿的mm吧,可是当时receipt藏哪了我给忘
了= =
http://shop.carmenmarcvalvo.com/Catalog/Detail.aspx?PriceCode=$390%20-%20$470&Var1
b********s
发帖数: 6928
42
我不精通的,用 cor( var1, var2)试试吧,default是Pearson's product-mome
nt correlation coefficient,是最基本的function
b********s
发帖数: 6928
43
类似这样的东西你难道不是大侠!
setwd("DIRECTORY")
data = read.csv("DATA.csv")
Y=data[,1]
X=data[,2]
correlation=cor(var1, var2)
summary(correlation)
h*******x
发帖数: 12808
44
好的,谢谢啊,我去查查。
var1,var2是数组吗?
b********s
发帖数: 6928
45
var1, var2是csv里面的column lable,就是variable name,呵呵
l*******3
发帖数: 1074
46
来自主题: Database版 - 请问一下怎么优化这个SQL查询?
MySQL数据库:
select something from table where varchar1 like "%var1%" and varchar2 = "
var2" and varchar3 = "var3";
table里大约有百万条几率,每次查询都需要几秒钟;我已经分别为varchar1,
varchar2,varchar3建立了单列索引和多列索引(varchar1和varchar2和varchar3,以
及varchar2和varchar3),改进不明显。
多谢指点!
B*********L
发帖数: 700
47
来自主题: Database版 - 这个query怎么写?
谢谢了。
看来的确没有特别简洁的办法。俺不死磕了,现在比较罗嗦的设了4个variable, in (
@var1,@var2,@var3,@var4),凑合用了。
r****y
发帖数: 26819
48
来自主题: DotNet版 - 问一个Page.Response的问题
想得到一个Response,只包含一个string,比如:"var1=good".
比如这个URL:http://www.flash-mx.com/mm/greeting.cfm
Response.ContentType = "text/plain";
Response.Clear();
Response.Write("isValidLogin=1");
这样做的结果是,如果在IE里view source的话,能看见,string后面还附加了HTML代
码。
http://www.flash-mx.com/mm/greeting.cfm的view source不含HTML代码。
怎样做到?
c**t
发帖数: 26
49
来自主题: Java版 - weird class definition
in hell.java class, I define it
import ....;
public class hell
{
private float var1=1;

public hell()
{
...;
}
...
public static void main()
{
hell a = new hell();
....
}
}
when I compile it, no problem. but when run java hell.class
it tells me Exception in thread "main" java.lang.NoClassDefFoundError
Anything wrong?
w********t
发帖数: 63
50
grep 'abc' *.* | wc -l
var1=$?
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)