Wolfram 언어

풍부한 Knowledgebase 액세스

미국 국립 과학 재단의 보조금

미국 국립 과학 재단 (NSF)은 2015년에 12,000건에 달하는 보조금을 수여하였습니다. 여기서는 www.nsf.gov/awardsearch/download.jsp의 데이터에 따라 보조금, 조사원, 관계 기관에 대해 조사해 봅니다. 특히, 이러한 데이터를 포함하는 엔티티 스토어를 ResourceObject로 로드하여 보조금의 크기 분포, 제안서와 보조금의 정량적 특성과 질적 특성, 관련 기관의 지리적 산포에 대해 조사합니다.

우선, ResourceObject로부터 NSF 데이터를 포함하는 보조금 엔티티 스토어를 로드합니다.

In[1]:=
Click for copyable input
nsfStore = ResourceData[ ResourceObject[ Association[ "Name" -> "National Science Foundation Grants - 2015", "UUID" -> "0e9655df-86b6-4e20-bcc9-87365562357b", "ResourceType" -> "DataResource", "Version" -> "1.0.0", "Description" -> "Data on National Science Foundation grants (and \ associated investigators and institutions) awarded in the the year \ 2015.", "ContentSize" -> Quantity[0, "Bytes"], "ContentElements" -> {"EntityStore"}]]]
Out[1]=

이 세션을 위해 스토어를 틍록합니다.

In[2]:=
Click for copyable input
PrependTo[$EntityStores, nsfStore];

스토어에서 "NSFGrant" 엔티티 유형을 사용하여 사용 가능한 보조금 특성을 살펴봅니다.

In[3]:=
Click for copyable input
EntityValue["NSFGrant", "Properties"]
Out[3]=

무작위로 선택한 보조금에 대한 데이터를 반환합니다.

전체 Wolfram 언어 입력 표시하기
In[4]:=
Click for copyable input
TextGrid[List @@@ (RandomEntity["NSFGrant"]["PropertyAssociation"] // SortBy[#, ByteCount] & // Normal // Take[#, 16] &), Dividers -> All, Background -> {Automatic, {{LightBlue, None}}}] // TraditionalForm
Out[4]//TraditionalForm=

보조금의 액수의 분포를 플롯합니다.

In[5]:=
Click for copyable input
awardAmounts = EntityValue["NSFGrant", "AwardAmount"];
In[6]:=
Click for copyable input
Histogram[awardAmounts, ScalingFunctions -> {Identity, "Log"}, PlotRange -> All, AxesLabel -> Automatic]
Out[6]=

가장 고액의 세가지 보조금의 세부 사항을 표시합니다.

In[7]:=
Click for copyable input
EntityValue[ EntityClass["NSFGrant", "AwardAmount" -> TakeLargest[3]], "Dataset"]
Out[7]=

NSF의 분야별 보조금 총액을 조사합니다.

전체 Wolfram 언어 입력 표시하기
In[8]:=
Click for copyable input
TextGrid[SortBy[{#1, Total[#2[[All, -1]]]} & @@@ Normal[GroupBy[ EntityValue["NSFGrant", {"Directorate", "AwardAmount"}], First]], Last] // DeleteMissing[#, 1, 2] & // Reverse, Alignment -> {{Left, Decimal}, Automatic}, Dividers -> All, Background -> {Automatic, {{LightBlue, None}}}]
Out[8]=

조성 금액 (달러)의 첫 번째 자리의 숫자를 벤포드의 법칙으로 비교합니다.

전체 Wolfram 언어 입력 표시하기
In[9]:=
Click for copyable input
With[{$s = QuantityMagnitude[ EntityValue["NSFGrant", EntityProperty["NSFGrant", "AwardAmount"]]]}, ListPlot[{Rest[Sort[Tally[IntegerDigits[#][[1]] & /@ $s]]], Table[{d, Length[$s] Log10[1 + 1/d]}, {d, 9}]}, Filling -> Axis, PlotLegends -> {"NSF grants", "Benford"}]]
Out[9]=

수학, 물리학, 화학 보조금에서 가장 많이 사용된 단어의 워드 클라우드를 작성합니다.

In[10]:=
Click for copyable input
keywords = EntityValue[EntityClass["NSFGrant", "Division" -> #], "KeywordTally"] & /@ {"Division Of Mathematical Sciences", "Division Of Physics", "Division Of Chemistry"};
In[11]:=
Click for copyable input
Row[WordCloud[ Merge[Association @@ (Rule @@@ #) & /@ DeleteMissing[#], Total]] & /@ keywords]
Out[11]=

ZIP 코드와 금액에 따른 NSF의 보조금을 시각화합니다.

전체 Wolfram 언어 입력 표시하기
In[12]:=
Click for copyable input
amountsandinsts = EntityValue[ "NSFGrant", {EntityProperty["NSFGrant", "AwardAmount"], EntityProperty["NSFGrant", "Institution"]}];
In[13]:=
Click for copyable input
amountsinzips = (#[[1, 1]] -> Total[#[[All, -1]]]) & /@ Normal[GroupBy[Transpose[{EntityValue[ amountsandinsts[[All, -1]], EntityProperty["NSFInstitution", "ZIPCode"] ], amountsandinsts[[All, 1]]}], First]][[All, -1]];
In[14]:=
Click for copyable input
GeoRegionValuePlot[SortBy[amountsinzips, Last], ColorFunction -> ColorData["GreenPinkTones"], GeoRange -> Entity["Country", "UnitedStates"], PlotLegends -> Histogram]
Out[14]=

관련 예제

de en es fr ja pt-br ru zh