Actuarial Outpost
 
Go Back   Actuarial Outpost > Exams - Please Limit Discussion to Exam-Related Topics > CAS > Certified Specialist in Predictive Analytics
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions


Fill in a brief DW Simpson Registration Form
to be contacted when new jobs meet your criteria.


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-12-2019, 12:45 PM
ButtressWOPersonality ButtressWOPersonality is offline
Member
CAS
 
Join Date: Jun 2011
Location: Existential Angst-Ville
Studying for iCAS3
College: UMass/BC
Posts: 78
Default E3: Fall 2019 Thread

Hello! Figure it is a good idea to kick things off with a thread on Fall 2019.

First question: in section B4, I can't find the data used in the code from Gelman and Hill in 11.3. The data for "smoking" on the website uses all numerical data, but the code requires data set with "f"s and "Ys".

Here is the code that Gelman includes on his website for 11.3... very not helpful in identifying the data, imo.

## Read in the data
# Data are at http://www.stat.columbia.edu/~gelman/arm/examples/?
data?
library ("arm")
?data
## Overall rate of smoking (figure 11.5)


## Pull out the smoking outcome: single data matrix
y <- data[,seq(6,12,2)]
female <- ifelse (data[,2]=="f", 1, 0)
mom.smoke <- ifelse (data[,3]=="Y", 1, 0)
dad.smoke <- ifelse (data[,4]=="Y", 1, 0)
psmoke <- mom.smoke + dad.smoke
__________________
ACAS 7 8 9
Reply With Quote
  #2  
Old 09-16-2019, 11:39 AM
ButtressWOPersonality ButtressWOPersonality is offline
Member
CAS
 
Join Date: Jun 2011
Location: Existential Angst-Ville
Studying for iCAS3
College: UMass/BC
Posts: 78
Default

UPDATE: I sent an email to Prof. Gelman... he acknowledged that the dataset is on the website is not correct.

Hi, BUTTRESSWOPersonality: I agree. It seems that the original dataset is not on the website. I think it's ok in this example to simply read the code in the text without trying to run it. The point of this example is simply that the data in this multilevel structure is stored in two different matrices, one for the person and one for the data points.
I hope this helps.
Andrew
__________________
ACAS 7 8 9
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 12:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.09848 seconds with 11 queries