This is a short introduction to the SAPA data set. The full list of personality items may be found in the itemInfo object. Here I show the names of the 45 demographic variables.

library(psych) #make psych active

With your browser, go to the file https://personality-project.org/courses/371/sapa.dictionary.rda
and move it to your computer.

Then, use the read.file function to find it and load it. fn <- file.choose() read.file(fn) #this gets the dictionary

fn <- "/Users/WR/Downloads/sapa.dictionary.rda"
read.file(fn)
## The file(s) in /Users/WR/Downloads/sapa.dictionary.rda have been loaded into your environment.
## [1] "/Users/WR/Downloads/sapa.dictionary.rda"
dim(ItemInfo)
## [1] 4475   17
headTail(ItemInfo[1:5]) #this is just the first and last few lines
##                                                                  Item IPIP100 BFAS HEXACO  QB6
## q_1                                        Abuse peoples confidences.    NULL NULL   NULL NULL
## q_2                                          Accept apologies easily.    NULL NULL   NULL NULL
## q_3                                         Accept challenging tasks.    NULL NULL   NULL NULL
## q_4                                        Accept little from others.    NULL NULL   NULL NULL
## ...                                                              <NA>    <NA> <NA>   <NA> <NA>
## q_4472 I am someone who is inventive, finds clever ways to do things.    NULL NULL   NULL NULL
## q_4473         I am someone who is original, comes up with new ideas.    NULL NULL   NULL NULL
## q_4474                        I am someone who has little creativity.    NULL NULL   NULL NULL
## q_4475              I am someone who has difficulty imagining things.    NULL NULL   NULL NULL

I am now going to get the data and show the first 50 columns

fn1 <- "/Users/WR/Box Sync/pmc_folder/SAPA items/latest sapa/SAPAdata18aug2010thru7feb2017.rdata"
read.file(fn1)
## The file(s) in /Users/WR/Box Sync/pmc_folder/SAPA items/latest sapa/SAPAdata18aug2010thru7feb2017.rdata have been loaded into your environment.
## [1] "/Users/WR/Box Sync/pmc_folder/SAPA items/latest sapa/SAPAdata18aug2010thru7feb2017.rdata"
ls()
## [1] "fn"                            "fn1"                           "ItemInfo"                     
## [4] "ItemLists"                     "keys.list"                     "SAPAdata18aug2010thru7feb2017"
sapa <- SAPAdata18aug2010thru7feb2017
colnames(sapa)[1:45]
##  [1] "RID"            "gender"         "age"            "marstatus"      "relstatus"     
##  [6] "height"         "weight"         "BMI"            "exer"           "smoke"         
## [11] "country"        "state"          "ethnic"         "zip"            "education"     
## [16] "discipline"     "major"          "jobstatus"      "jobfield"       "jobFldPrestige"
## [21] "jobFldIncome"   "occupation"     "occPrestige"    "occIncomeEst"   "p1occ"         
## [26] "p1occPrestige"  "p1occIncomeEst" "p1edu"          "p2occ"          "p2occPrestige" 
## [31] "p2occIncomeEst" "p2edu"          "ZCTA"           "ZCTAcounty"     "ZCTAstate"     
## [36] "zipState"       "zipCity"        "ZCTAlat"        "ZCTAlon"        "Pop"           
## [41] "PopDensity"     "MedInc"         "logMedInc"      "Gini"           "EthDiv"
#show the kind of data that we have
headTail(sapa[1:45])
##               RID gender age     marstatus    relstatus height weight   BMI   exer smoke country
## 1           52392 female  43     DivSingle    committed   <NA>   <NA>  <NA>   <NA>  <NA>     USA
## 2           71592 female  18  neverMarried    committed   <NA>   <NA>  <NA>   <NA>  <NA>     CAN
## 3           78233   male  32 domesticPrtnr    committed     68    148  22.5   <NA>  <NA>     USA
## 4           89104 female  21  neverMarried    committed   <NA>   <NA>  <NA>   <NA>  <NA>     USA
## ...           ...   <NA> ...          <NA>         <NA>    ...    ...   ...   <NA>  <NA>    <NA>
## 255345 2147454037 female  19  neverMarried    committed     67    103 16.13   <NA>  <NA>     USA
## 255346 2147455317   male  64       married    committed     68    198  30.1   <NA>  <NA>     USA
## 255347 2147479761   male  17  neverMarried notCommitted     69    148 21.85 3or5wk never     USA
## 255348 2147481734 female  45       married    committed     64    118 20.25   <NA>  <NA>     USA
##             state  ethnic   zip     education      discipline
## 1         Florida AfrAmer  <NA> CurrentInUniv        Business
## 2         Alberta    <NA>  <NA>        HSgrad            <NA>
## 3        New York  Prican  <NA> CurrentInUniv Social Sciences
## 4      California MexAmer  <NA> CurrentInUniv        Business
## ...          <NA>    <NA>   ...          <NA>            <NA>
## 255345  Louisiana   White  <NA> CurrentInUniv            <NA>
## 255346      Texas   White  <NA> CollegeDegree Social Sciences
## 255347 Washington  Prican 98053     less12yrs            <NA>
## 255348   Illinois   White  <NA> CurrentInUniv Social Sciences
##                                         major jobstatus                  jobfield jobFldPrestige
## 1      Business Administration and Management Homemaker                      <NA>           <NA>
## 2                                        <NA>   student                      <NA>           <NA>
## 3                                 Criminology   student                      <NA>           <NA>
## 4                                  Accounting   student                      <NA>           <NA>
## ...                                      <NA>      <NA>                      <NA>            ...
## 255345                                   <NA>   student                      <NA>           <NA>
## 255346            Other Social Sciences Major  Employed ArtsDesignEntnSportsMedia          67.72
## 255347                                   <NA>   student                      <NA>           <NA>
## 255348                             Psychology Homemaker                      <NA>           <NA>
##        jobFldIncome occupation occPrestige occIncomeEst                  p1occ p1occPrestige
## 1              <NA>       <NA>        <NA>         <NA>                   <NA>          <NA>
## 2              <NA>       <NA>        <NA>         <NA>                   <NA>          <NA>
## 3              <NA>       <NA>        <NA>         <NA>               Military         67.85
## 4              <NA>       <NA>        <NA>         <NA>    InstallMntnceRepair          43.3
## ...             ...       <NA>         ...          ...                   <NA>           ...
## 255345         <NA>       <NA>        <NA>         <NA>   BusinFinanOperations         67.12
## 255346        55790     Writer          70        60250             Management         63.85
## 255347         <NA>       <NA>        <NA>         <NA>             Management         63.85
## 255348         <NA>       <NA>        <NA>         <NA> ConstructionExtraction         42.08
##        p1occIncomeEst         p1edu                     p2occ p2occPrestige p2occIncomeEst
## 1                <NA>          <NA>                      <NA>          <NA>           <NA>
## 2                <NA>          <NA>                      <NA>          <NA>           <NA>
## 3                <NA> CollegeDegree                      <NA>          <NA>           <NA>
## 4               45220          <NA>                      <NA>          <NA>           <NA>
## ...               ...          <NA>                      <NA>           ...            ...
## 255345          72410        HSgrad    FarmingFishingForestry         38.66          25160
## 255346         112490   SomeCollege                      <NA>          <NA>           <NA>
## 255347         112490          <NA>                      <NA>          <NA>           <NA>
## 255348          46600        HSgrad ArtsDesignEntnSportsMedia         67.72          55790
##                p2edu  ZCTA ZCTAcounty ZCTAstate zipState zipCity ZCTAlat ZCTAlon   Pop PopDensity
## 1               <NA>  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## 2               <NA>  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## 3          less12yrs  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## 4               <NA>  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## ...             <NA>   ...        ...      <NA>     <NA>    <NA>     ...     ...   ...        ...
## 255345        HSgrad  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## 255346   SomeCollege  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
## 255347          <NA> 98053      53033        WA       WA Redmond   47.67 -122.01 18784     662.22
## 255348 CollegeDegree  <NA>       <NA>      <NA>     <NA>    <NA>    <NA>    <NA>  <NA>       <NA>
##        MedInc logMedInc Gini EthDiv
## 1        <NA>      <NA> <NA>   <NA>
## 2        <NA>      <NA> <NA>   <NA>
## 3        <NA>      <NA> <NA>   <NA>
## 4        <NA>      <NA> <NA>   <NA>
## ...       ...       ...  ...    ...
## 255345   <NA>      <NA> <NA>   <NA>
## 255346   <NA>      <NA> <NA>   <NA>
## 255347 116518     11.67 0.41   0.27
## 255348   <NA>      <NA> <NA>   <NA>