1 / 10

MONEY??

MONEY??. LIBRARIES??. Felix Kabo, M.Arch , Ph.D. LIBRARIES NATIONAL INSTITUTES OF HEALTH FUNDING. use bdc2014 create table ill_institutions ( Institution varchar ( 255 ), City varchar ( 125 ), State varchar ( 50 ), Zipcode varchar ( 9 ), RU_VH varchar ( 1 ), ARL varchar ( 1 ),

Download Presentation

MONEY??

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MONEY?? LIBRARIES?? Felix Kabo, M.Arch, Ph.D.

  2. LIBRARIES NATIONAL INSTITUTES OF HEALTH FUNDING

  3. usebdc2014 createtableill_institutions ( Institution varchar(255), City varchar(125), Statevarchar(50), Zipcodevarchar(9), RU_VHvarchar(1), ARLvarchar(1), ACAD_RESvarchar(1), Public_100K varchar(1), Public_CAvarchar(1), latitude float, longitude float ); bulkinsertill_institutions from'C:\Users\Felix Kabo\Desktop\BDC Knowledge Institutions.txt' with (firstrow=2); --406 rows

  4. createtable nihgrants2013 ( ORGANIZATION varchar(255), AWARDS int, FUNDING int, CITY varchar(125), STATEvarchar(2) ); bulkinsert nihgrants2013 from'C:\Users\Felix Kabo\Desktop\NIH Funding FY2013.txt' with (firstrow=2); --2292 rows

  5. selectsum(FUNDING)asmoneyflows,upper(CITY)as city,upper(STATE)asstate intomoneysum from nihgrants2013 groupby CITY,STATE orderbymoneyflows --813 rows select*intoknowledge_houses fromill_institutions leftjoinstates_abbreviations onill_institutions.State= states_abbreviations.ST --406 rows

  6. selectCOUNT(Institution)asknowledge_counts,upper(City)as cities,ABBRas states fromknowledge_houses groupby City,ABBR orderbyknowledge_counts --318 rows selectCOUNT(Institution)asknowledge_counts,upper(City)as cities,ABBRas states fromknowledge_houses whereABBR!='NULL' groupby City,ABBR orderbyknowledge_counts --279 rows

  7. selectCOUNT(Institution)asknowledge_counts,upper(City)as cities,ABBRas states intototal_knowledge fromknowledge_houses whereABBR!='NULL' groupby City,ABBR orderbyknowledge_counts --279 rows select*intomoney_knowledge frommoneysum leftjointotal_knowledge onmoneysum.city=total_knowledge.cities andmoneysum.state=total_knowledge.states --813 rows

  8. select*frommoney_knowledge where states!='NULL' orderbymoneyflows --194 rows select*frommoney_knowledge whereknowledge_counts>0 orderbymoneyflows --194 rows

  9. --Finally, take easy route and calculate correlations in Stata...or do it in SQL altertablemoney_knowledge altercolumnmoneyflowsbigint declare @mean1 decimal(20,6) declare @mean2 decimal(20,6) select @mean1=AVG(moneyflows*1.0) ,@mean2=AVG(knowledge_counts*1.0) frommoney_knowledge whereknowledge_counts>0; select (SUM((moneyflows*1.0-@mean1)*(knowledge_counts*1.0-@mean2))/COUNT(*)) /((STDEVP(moneyflows*1.0)*STDEVP(knowledge_counts*1.0)))as correlation frommoney_knowledge whereknowledge_counts>0; --0.554758521032079 Is it elegant? Maybe not...but you get the picture

  10. MORE LIBRARIES = MORE MONEY!!

More Related