01-23-2018
Hani
Calcite | Level 5
Member since
06-23-2011
- 12 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Hani
Subject Views Posted 2482 09-10-2014 06:35 PM 2482 09-10-2014 05:51 PM 2482 09-10-2014 05:24 PM 2577 09-10-2014 04:41 PM 884 08-28-2014 06:54 PM 961 08-28-2014 06:36 PM 1531 05-08-2011 01:33 AM 1531 05-07-2011 02:47 PM 1536 05-07-2011 05:43 AM 1424 04-27-2011 08:11 PM -
Activity Feed for Hani
- Posted Re: Proc surveyfreq on SAS Data Science. 09-10-2014 06:35 PM
- Posted Re: Proc surveyfreq on SAS Data Science. 09-10-2014 05:51 PM
- Posted Re: Proc surveyfreq on SAS Data Science. 09-10-2014 05:24 PM
- Posted Proc surveyfreq on SAS Data Science. 09-10-2014 04:41 PM
- Posted Re: CI for stratified sample (discrete variable) on SAS Procedures. 08-28-2014 06:54 PM
- Posted CI for stratified sample (discrete variable) on SAS Procedures. 08-28-2014 06:36 PM
- Posted Re: ABC of macro on SAS Procedures. 05-08-2011 01:33 AM
- Posted Re: ABC of macro on SAS Procedures. 05-07-2011 02:47 PM
- Posted ABC of macro on SAS Procedures. 05-07-2011 05:43 AM
- Posted Re: Matching on SAS Programming. 04-27-2011 08:11 PM
- Posted Matching on SAS Programming. 04-26-2011 06:44 PM
09-10-2014
06:35 PM
Thanks to all, I think I will be able to figure it out from here. Appreciate it. Best
... View more
09-10-2014
05:51 PM
Thanks for the detailed response. Yes, it was a simple random sample within each strata. No, I didn't use the proc surveyselect. So, if I understand it correctly, the weight of the subjects in each strata will be the total population divided by the sample size from this strata?? Am I right?
... View more
09-10-2014
05:24 PM
I would appreciate if you can just let me know briefly how, or refer me to any link. Thanks a lot.
... View more
09-10-2014
04:41 PM
Dear all, I am carrying out a national survey, with stratified sampling. To account for this, I am going to use the "proc surveyfreq", but I am wondering how to figure out the weights that I should use. I would appreciate any feedback, help, links or anything that might help me figure it out. Thanks in advance. Best
... View more
08-28-2014
06:54 PM
Thanks a lot. I have never used this proc. I will try to look something up. I would appreciate if anyone has a sample code for it. Thanks
... View more
08-28-2014
06:36 PM
Hello all, I need some help. I am interested in calculating a Confidence Interval for a discrete variable, from a sample that was based on a stratified method. Anyone can help? Thanks
... View more
05-08-2011
01:33 AM
Hello Patrick,
Thanks for the suggestion, I will run it as well. I prefer not to use macros as I am not very comfortable with it.. I hope this will work as well.
Thanks
hani
... View more
05-07-2011
05:43 AM
Hello all,
I would like to run the following two programs with a macro. Can somebody help me.
I need to run it for different cases (from 1 to 10), and what I need to vary from 1 to 10 are specified below.
I have basic knowledge in macros, and I appreciate your help.
Thanks
data sample1; /*sample1 to sample10*/
set sample;
if id_case=1; /*case1 to case10*/
run;
data Control;
merge Control1 /*control1 to control10*/
Sample1 ; /*sample1 to sample10*/
by ID_case;
run;
... View more
04-27-2011
08:11 PM
Hello,
Thanks for the replies.
Basically, I have a group of cases, and another group of controls.
I need to match 1 control for each case on 1 continuous variables (LOS), where the matching criteria is +/- 1.
For instance:
case subject A, LOS=1.5,
case subject B, LOS=2.0,
control subject a, LOS=1.7,
control subject b, LOS=1.9,
In this case, control subject a is a potential controls for both cases A and B, since the LOS is within the 1 year of the case. Similarly, control subject b is a potential controls for both case subjects A and B.. So, what I need is to select a random control for case subject A, and this control should not be replaced in the pool, and thus not to be considered again for case subject B.
Based on the recommended paper published by Hugh Kawabata, I have already used this paper, and following is the program I usedfrom this paper.
I know there is something wrong in the coding since very few controls are being selected for all of the cases.
Finally, I would appreciate your help in identifying the problem I have
Thanks you very much
Hani
data study control;
set matching;
rand_num=uniform(0);
if case=1 then output study;
else output control;
run;
data control2;
set control;
LOS_low=LOS-1;
LOS_high=LOS+1;
run;
proc sql;
create table controls_id as
select
one.studyid as study_id,
two.studyid as control_id,
one.LOS as study_LOS,
two.LOS as control_LOS,
one.rand_num as rand_num
from study one, control2 two
where (one.LOS between two.LOS_low and two.LOS_high);
quit;
* count the number of control subjects for each case subject;
proc sort data=controls_id ;
by study_id ;
run;
data controls_id2(keep=study_id num_controls);
set controls_id;
by study_id;
retain num_controls;
if first.study_id then num_controls=1;
else num_controls=num_controls+1;
if last.study_id then output;
run;
* now merge the counts back into the dataset;
data controls_id3;
merge controls_id
controls_id2;
by study_id;
run;
* now order the rows to select the first matching control;
proc sort data=controls_id3;
by control_id num_controls rand_num;
run;
data controls_id4;
set controls_id3;
by control_id;
if first.control_id;
run;
*Now, as before, randomly select the fixed number (in our example, two) of control subjects for each case.;
proc sort data=controls_id ;
by study_id rand_num;
run;
data controls_id2 not_enough;
set controls_id;
by study_id ;
retain num;
if first.study_id then num=1;
if num le 2 then do;
output controls_id2;
num=num+1;
end;
if last.study_id then do;
if num le 2 then output not_enough;
end;
run;
proc print data=controls_id2(obs=40);
title2 'matched patients';
run;
... View more
04-26-2011
06:44 PM
Hello,
I am carrying out a case - controls study. I would like to match 1 control for each case, and the matching is on a continuous variable (age) which is supposed to be +/- 1 year. I would like to have the control to be used only once, rather than being selected more than once for different cases.
I would appreciate any help on this.
Thanks
Hani
... View more