Converting Excel files into SAS via. SAS vs. SPSS

I have SAS and SPSS on my PC and have a choice of using SAS or SPSS when converting an Excel file into a SAS dataset.  In terms of reading a date variable, SAS reads the data as is.  SPSS reads it and returns a different value.

This is the original date value for one case in the Excel file.

3/1/2016

SAS PROC IMPORT returned the same date.

01MAR2016

SPSS's IMPORT process (into a SAS dataset) returned this:

02MAR2076

To force SPSS to correct the data, you need to subtract 21916 from the date (which converts the date of this case to be March 1st of 2016).

data spss;set raw.Assessment_spss;
keep DateTaken_74;
FORMAT DateTaken_74 date9. ;
DateTaken_74=DateTaken_74 -21916;
run;

 

Here is the difference in terms of how they read column names.  I read the same Excel table using SAS and SPSS.

SAS PROC IMPORT uses __ (two spaces) when it finds a space in column names.  SPSS ignores spaces.

SAS SPSS
Variable Variable
Site_Name SiteName
Case_Number CaseNumber
Academic_issues__disabled__1066 Academicissuesdisabled_1066

Survival Analysis using SAS

libname yama "C:\Users\";

data asdf;
set yama.test_data;
OS_length=(OS-toroku_bi)/30.5;
run;

proc lifetest data=asdf;
time OS_length*OS_event(0);
*strata shiken_gun;
run;

proc lifetest data=asdf;
time OS_length*OS_event(0);
strata shiken_gun;
run;

proc lifetest data=asdf;
time OS_length*OS_event(0);
strata PS;
run;

proc phreg data=asdf;
class sex soshiki_gata shiken_gun;
model OS_length*OS_event(0)=shiken_gun sex soshiki_gata PS;
run;

proc phreg data=asdf;
class sex soshiki_gata shiken_gun;
model OS_length*OS_event(0)=shiken_gun;
run;

R question

I am trying to create this function, but I think the problem parts are where I tried to put macro tokens (e.g., var1, var2, var3) within "".    I'm getting error messages.  Any suggestions welcome.  Rでファンクションを書いているのですが、” ”の間に、var1,var2,var3を入れるとエラーが出ます。どうしたらいいでしょうか? This is the error message:

Error in eval(cols[[col]], .data, parent.frame()) : 

object 'var3.y' not found

 

<ここから>

 

make_tables<-function(var1,var2,var3){
analysis_data %>%
mutate(difference=var3.y-var3.x) -> analysis_data_b
analysis_data_c<-filter(analysis_data_b,difference >= 0)

result01pre <-Summarize(var3.x ~ group.x, data= analysis_data_c)
result01pre$test_type<-"Pretest"
result01pre$surveyID<- "var2"
result01pre$tableID<- "var1"
result01pre$item<- "var3.x"
result01pre=subset(result01pre,select=c(tableID, surveyID, item,test_type,group.x,n,mean))

result01post<-Summarize(var3.y ~ group.y, data= analysis_data_c)
result01post$item<- "var3.y"
result01post$test_type<-"Posttest"
result01post=subset(result01post,select=c(item,test_type,group.y,n,mean))

result01diff<-Summarize(difference ~ group.x, data= analysis_data_c)
result01diff$item<- "difference"
result01diff$test_type<-"Difference"
result01diff=subset(result01diff,select=c(item,test_type,group.x,n,mean,sd))

all01<-merge(result01pre,result01post,by.x="group.x",by.y="group.y",all.x = TRUE, all.y = TRUE)
all01<-merge(all01,result01diff,by.x="group.x",by.y="group.x",all.x = TRUE, all.y = TRUE)
#Paired t-test algorithm

all01 %>%
mutate(t_score = (t_score=mean/(sd/sqrt(n)))) %>%
mutate(sig_test=case_when(
t_score < 1.96 ~"ns",
t_score >= 1.96 ~"sig")) ->all01
}}

kaz1 <- make_tables(30,1,miss_5_d_affects_n)

French expressions per Google

confirm-> confirmer

the list of -> la liste de

control -> contrôle

already -> déjà

author -> auteure

I meet -> je rencontre

I found ->

j'ai trouvé

Error messages  -> messages d'erreur

run -> courir

I woke up -> je me suis réveillé

I get an error -> J'obtiens une erreur

buy -> acheter

listen -> Ecoutez ,  J'écoute

light-> lumière

girl ->fille

I stand up ->je me lève

I take a shower ->je prends une douche

I need to-> J'ai besoin de

I now read a book ->

Je lis maintenant un livre