SAS PROC SQL -- merging and calculation
proc sql ;
create table new as
select a._Material_Substance_Use_Abuse,
(a._1_Yes+a._2_No) as total_n, a._1_Yes as Yes_n, a._2_No as No_n,
a._3_Section_not_available as No_no_section,
(a._1_Yes/(a._1_Yes+a._2_No)) as YES_percentage_wo_sec,
(a._1_Yes/(a._1_Yes+a._2_No+a._3_Section_not_available)) as YES_percentage_w_sec
from Eye_twoT1 AS a
;
SAS PROC EXPORT
%let excelname=C:\Users....\xxx.xlsx;
PROC EXPORT DATA=_5_&num._result_&outcome OUTFILE= "&excelname"
DBMS=xlsx REPLACE;
sheet="&num.&outcome";
RUN;
PW
Bank The one eyed dog without !
SAS PROC SQL how to keep cases
proc sql;
create table in_tab12 as select *,
count(distinct laptopID) as duplic
from in_tab1
group by Referral_number
having duplic > 1;
run;
SAS PROC SQL
Get the number of distinct values.
proc sql;
create table temp2 as select *,
count(distinct ID) as duplic
from final.cleaned
group by Case_num;
run;
SQL keep data when they also exist in another table
proc sql;
create table final.Cleaned_IN_tab3_edited as
select *
from li_tab3_ref_b2 as A
where exists (SELECT 1 from final.roster as B
where A.Referral_number=B.Referral_number);
run;
Kingfish
Tribute By Son To His Mother@ Her Home-going Service/ 50 Birthday Celebration. Amazing Grace!????
Posted by Bridgett Rayborn Crutchfield on Saturday, December 14, 2019
R purrr
library(tidyverse)
my_list<-list(
c(1,2,6),
c(4,7,1),
c(9,1,5)
)
my_list[[1]] %>% mean()
my_list %>% map_dbl(mean)
map(my_list,mean)
my_list %>% map(~ . *1)
my_list %>% map(~ . *2)
pop<-rnorm(10000)
n<-1:1000
m1<-rep(NA,length(n))
for (i in n){
x<-sample(pop,i)
m1[i]<-mean(x)
}
plot(m1,type="l")