Translate

Thursday, November 26, 2020

Bitcoin Analysis as of 11-24-2020

 




/* Generated Code (IMPORT) */
/* Source File: DATA.csv */
/* Source Path: /folders/myfolders/Stock Market */
/* Code generated on: 11/25/20, 10:12 AM */

%web_drop_table(WORK.IMPORT);


FILENAME REFFILE '/folders/myfolders/Bitcoin.csv';

PROC IMPORT DATAFILE=REFFILE
DBMS=CSV
OUT=WORK.Bitcoin;
GETNAMES=YES;
RUN;

proc sort data=bitcoin out=bitcoin;
by date;
run;

proc sgplot data=Bitcoin;
title height=14pt "Bitcoin";
footnote2 justify=left height=8pt "Source: Coinbase";
series x=Date y=Last /;
xaxis grid;
yaxis grid;
run;

ods graphics / reset;
title;
footnote2;

DATA Bitcoin.Bitcoin;
set Bitcoin (drop=VAR1);
rename Last=Bitcoin;

Year=Year(Date);
Month=Month(Date);
Day=Day(Date);

pctchng = dif(Last) / lag( Last ) * 100;
label pctchng = "Percent Change";

pctchng_month = ( ( Last / lag( Last ) ) ** 30 - 1 ) * 100;
label pctchng_month = "Monthly Percent Change, At Annual Rates";

pctchng_yr = dif365( Last ) / lag365( Last ) * 100;
label pctchng_yr = "Percent Change from One Year Ago";
run;


proc sgplot data=Bitcoin.Bitcoin;
title height=14pt "Percent changes from previous year";
footnote2 justify=left height=8pt "Source: Coinbase";
series x=Date y=pctchng_yr /;
xaxis grid;
yaxis grid;
run;

proc sgplot data=Bitcoin.Bitcoin;
title height=12pt "Bitcoin";
vbar Year / response=pctchng fillattrs=(color=CXcad5e5) datalabel;
yaxis grid;
run;

proc sgplot data=Bitcoin.Bitcoin;
vbar Month / response=pctchng fillattrs=(color=CXcad5e5) datalabel stat=mean;
yaxis grid;
run;

proc sgplot data=Bitcoin.Bitcoin;
vbar Day / response=pctchng fillattrs=(color=CXcad5e5) datalabel stat=mean;
yaxis grid;
run;




SAS codes


FILENAME REFFILE '/folders/myfolders/Bitcoin.csv';
PROC IMPORT DATAFILE=REFFILE
DBMS=CSV
OUT=WORK.Bitcoin;
GETNAMES=YES;
RUN;
proc sort data=bitcoin out=bitcoin;
by date;
run;
proc sgplot data=Bitcoin;
title height=14pt "Bitcoin";
footnote2 justify=left height=8pt "Source: Coinbase";
series x=Date y=Last /;
xaxis grid;
yaxis grid;
run;
ods graphics / reset;
title;
footnote2;
DATA Bitcoin.Bitcoin;
set Bitcoin (drop=VAR1);
rename Last=Bitcoin;
Year=Year(Date);
Month=Month(Date);
Day=Day(Date);
pctchng = dif(Last) / lag( Last ) * 100;
label pctchng = "Percent Change";
pctchng_month = ( ( Last / lag( Last ) ) ** 30 - 1 ) * 100;
label pctchng_month = "Monthly Percent Change, At Annual Rates";
pctchng_yr = dif365( Last ) / lag365( Last ) * 100;
label pctchng_yr = "Percent Change from One Year Ago";
run;
proc sgplot data=Bitcoin.Bitcoin;
title height=14pt "Percent changes from previous year";
footnote2 justify=left height=8pt "Source: Coinbase";
series x=Date y=pctchng_yr /;
xaxis grid;
yaxis grid;
run;
proc sgplot data=Bitcoin.Bitcoin;
title height=12pt "Bitcoin";
vbar Year / response=pctchng fillattrs=(color=CXcad5e5) datalabel;
yaxis grid;
run;
proc sgplot data=Bitcoin.Bitcoin;
vbar Month / response=pctchng fillattrs=(color=CXcad5e5) datalabel stat=mean;
yaxis grid;
run;
proc sgplot data=Bitcoin.Bitcoin;
vbar Day / response=pctchng fillattrs=(color=CXcad5e5) datalabel stat=mean;
yaxis grid;
run;



No comments:

Post a Comment