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;

How to make the blog entry boxes smaller vertically

The default way of WordPress does not work for the Japanese language but I have added the following code to manage it.

function buddyboss_custom_short_excerpt($excerpt){
    $limit = 300;

    if (strlen($excerpt) > $limit) {
        return substr($excerpt, 0, strpos($excerpt, ' ', $limit));
    }

    return $excerpt;
}

add_filter('the_excerpt', 'buddyboss_custom_short_excerpt');

Need help with R

Thanks for helping me with R's ifelse.

This creates a fake dataset.
test = expand.grid(a = c(1, 2, 3, 4), b = c(1, 2, 3))

What I want to do is to something like this:

if a=3 then do;

if b=1 then news="3 and 1";

if b=2 then news="3 and 2";

end;

 

This below does half of the job.  Could you advise?

test$news <- ifelse(test$a == 3,ifelse(test$b == 1, "3 and 1",""),"")

Please email me at k u e k a w a @gmail.com .

Thanks.