Dear programmers,
Please i need help to do 2 questions. I'm practicing for the Base SAS exams and i could not write the codes for these questions.
Any help or answer will be appreciated.
2. Assume you have a data file called VIRUS_PROLIF from an infectious disease research center. Each observation has 3 variables SAMPLE_NUMBER CELL_TYPE, and COUNT, where COUNT is a value for the initial count of the number of virions in a cell. If we assume that the virions replicate at a rate such that the total number of virions will increase by 10% per minute, write the SAS code using DO UNTIL to calculate how long one would predict it would take (in minutes) for the number of virions to exceed 100,000 for each cell.
Then, write the SAS code using a data step and accumulating variables to calculate the minimum, maximum, and average time to exceed 100,000 virions for the cells of each CELL_TYPE.
I don't believe arrays are covered in the Base exam.
https://www.sas.com/content/dam/SAS/en_us/doc/other1/certification/exam-content/base-programmer.pdf
Thanks. I am learning both because my work need me to know them also.
Any help is appreciated.
Dear programmers,
Please i need help to do 2 questions on a SAS practice. Any help or answer will be appreciated. The questions and the codes that i wrote are attached.
data NewPatientTemp (drop=i);
set Inf_Temps;
/*Code to declare arrays*/
array FTemp{25} FTemp_01-FTemp_25;
array Temps_New{25} Temps_New1-Temps_New25;
/*Do loop to convert Fahrenheit temps to Celsuis*/
do i=1 to 25;
Temps_New(i)= 5/9* (Temps (i) - 32);
end;
run;
2. Assume you have a data file called VIRUS_PROLIF from an infectious disease research center. Each observation has 3 variables SAMPLE_NUMBER CELL_TYPE, and COUNT, where COUNT is a value for the initial count of the number of virions in a cell. If we assume that the virions replicate at a rate such that the total number of virions will increase by 10% per minute, write the SAS code using DO UNTIL to calculate how long one would predict it would take (in minutes) for the number of virions to exceed 100,000 for each cell.
data Virus_prolif;
do until (count>100000);
minute+1;
count+ (counts*0.1);
end;
run;
proc print data=Virus_Prolif noobs;
run;
Please I need code critique and how i can make it better.
data Virus_prolif;
do until (count>100000);
minute+1;
count+ (counts*0.1); <= since count is undefine AND Counts is undefined then missing + missing is missing and you never reach any value so the loop never stops. Make sure the loop counter variable is the same in both places and there is a non-zero value set somewhere prior to the DO UNTIL statement using the variable.
end;
run;
Show what you have tried and either show the errors or explain why it doesn't do what you want.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.