Working *Rccs* models

From InterSciWiki
Revision as of 12:59, 30 November 2010 by Ahwalker (talk | contribs) (3 Models not ready - need work - you need some work in class on your own and to get help! - raise your hand)
Jump to: navigation, search

Chronology of class meetings fall 2010 - Edu-Mod 2009-10: The Individual Studies

  • WARNING: Your list of indep_vars must have at least one additional variable compared to restrict_vars

Installing and working with the R package *Rccs* at home AND at the classroom wiki

  • Mac or PC: SCCS R package Install
  • You can also work from anywhere in the world and you dont need to be in this class to do so -- this is EduMod


Students with problems

Discussion: In response to the professor's email ("if you have any questions, you can post on the wiki"):

"There are now full and explicit instructions (and advice) on the chronology site for tomorrow's class, and you can read, study and practice those instructions".

These full and explicit instructions still have me confused. I don't think its just me, either. I think many of the other students in the class are also confused. These students in class are afraid to speak up, probably because they don't even know what exactly it is they cannot do. In order for us to write this paper, we need information and statistics to write about. We can't get information when we are still stuck in the first few steps. We can all show up on time and pay attention, but using an unfamiliar program with multiple steps can be difficult for us to get on the first try.

I am posting this to this page (I'm not even entirely sure where it is we are to be posting) so other students know that they are not alone. If you asked the confused students to raise their hands, only a few would do it even if 15 were completely lost. Please address these concerns and help us students walk out of class Tuesday with enough information that we understand to write a paper.

DRW: Posting here or below is fine. The confusion is diminishing, and will diminish further, especially when all (almost) students have chosen a dep_var. Not enought time Tuesday to solve everyone's problems.


Professor White,

I am still a little confused as to where the meat of our papers will be coming from. When you say "list of readings", is that something we need to find from the R program, or can we find readings from, say, google scholar or the library resources? I am confused as to what extent the R software will be influencing our papers.


DRW: The "list of readings" will come from google scholar directed search http://intersci.ss.uci.edu/wiki/index.php/Sources_for_codes_and_articles_on_the_SCCS

Tomorrow: Oct 7 we will do a new stage that we did not get to on Tuesday the 5th -- expanding the restricted_vars -- the R software student sites where I have helped to illustrate those changes are marked UR/2 below.


ANYONE WHO WANTS should take the extension on your sketch of project due tomorrow: I discovered that the prototype based on ValueOfChildren generated errors when Sanday668 was twice repeated and called twice in the restricted_vars. My error: Corrected that everywhere and reran some of the programs with results.

Students with problems missing 1 page "what you think the course is about after reading Herb Simon article"

  • Bakshi - no work beyond 1A. No dep_var. Seriously behind the rest of the class!!!
  • -->No day 1 page assignment after reading Simon
  • De Ramos
  • Hejazi
  • Walker -- also no 2nd paper -- not attending class
  • Zhu Q
    • AWOL/MIA from wiki
  • User talk:Marforid also no day 1 page - emailed me. What's up, Dwayne? You say you will show up in class but you have never been in class to my knowledge.
  • Sun, Jie also no day 1 page - no attendance

Codebook to choose your topic (dependent) variable and Place to put your TOPIC

SCCS 2SLS Variable Names
  • - The new UR/2 procedure is at the front of those projects where it has been used.
  • - If you haven't added a topic next to your name, click EDIT at the side of this page and then type it next to your name.
  • Discussion: Many students have added their topic. How come there are links and citations? Isn't this just for your topic? Links and citations make students who are not using them think they are doing something wrong.
  • DRW: Citations are ok here too, but optional. They can also go in your page.
  • Discussion: Though it was a very good idea to post to this page instructions (like "find variable number"), we do not understand how we do that. Some students have completed the steps in class and thats great for them, but continuing the steps for these students leaves everyone else behind and lost. Please clarify.
  • DRW: thanks for these comments. Almost everyone now has a dep_var number and var name. That was the object. Logically, that was the first step. Tolga and I couldn't help a student with developing their model (==2A== for example) so those students needed to catch up.
  • sccs codebook
  • 180 variable version
  • Edu-Mod 2009-10: The Individual Studies -- previous class results -- you can look here to see if anyone has studied your dep_var before. The new list of indep_vars however should give new results

Model topics ranked by readiness for presentation

1 not attending

  • Sun, Jie also no day 1 page - no attendance

3 Models not ready - need work - you need some work in class on your own and to get help! - raise your hand

Sick or almost finished  :I thought I had dropped the class but did not realize I could not after second week; need to finish and hoping it is possible at this point.

1 models Nearly ready for powerpoint

17 models ready for powerpoint

You may want to define one of these dichotomies
dep_var=(sccs$740<=2)*1 #individual ----------- : dep_var=(sccs$740>=5)*1 #parents
Co-Wife Conflict and Co-operation. William Jankowiak, Monika Sudakov
  • UR/2

10 Models Presented

References: Broude, Gwen, and Sarah J. Greene. 1976. Cross-Cultural Codes on Twenty Sexual Attitudes and Practices. ETHNOLOGY. 15:409-429. http://www.jstor.org/stable/3773308
Ok that only helped a tiny bit, now I improved your 10A and 10B somewhat by that method again It might be well to define in a 11A and get 11B results for depvar<--(sccs$v739>2)*1 and in a different run in a 12A 12B depvar<--(sccs$v739>4)*1
Dance and Human History - CD "Rhythms of the Earth" includes Dance and Human History CD http://www.media-generation.com/DVD%20PAGES/Rhythms/Rhythm.htm I ordered the CD and we can play the 40 minute movie which features the 186 sccs sample for films on Human Dance and cross-cultural analyses Doug 14:07, 29 September 2010 (PDT)

Older text

Older text

How to do your CreateModel....R program

New Method

YOUR LIFE JUST GOT EASIER: THESE "prototype" programs now have more my_sccs and indep_vars, copy those for indep_vars to restrict_vars<-c( ...) and you can test ALL those new variables, selecting those that are significant (deleting those that are not in the next run -- copy, paste to new page in wiki, then delete restrict_vars<-c( ...) that were not significant)


I'm sorry, but even though this has made it easier for us,
"THESE "prototype" programs now have more my_sccs and indep_vars, copy those for indep_vars to restrict_vars<-c( ...) "
still makes no sense to students.

What is our variable? Mine, for example, is "744. (Neg) Frequency of Divorce (VAR LABEL REVERSED)". Would it be 744? What does it have to do with "CreateModelDRWpolygyny.R"? Where does GoogleScholar come in?

  • Stage 1 Choose a working "prototype", e.g, one of these: (See day 6, each of these has been slightly updated for making maps)
- all have many more indep_vars for UR/2 procedure - but if you put too many vars in restrict_vars you may get a run error - let me know!
CreateModelDRWpolygyny.R
CreateModelValueSDWchildren.R   - corrected indep_vars and restrict_vars -- fixed "Sanday668","Sanday668" --> "Sanday668","Sanday669"
CreateModelValueSDWchildren2.R - corrected indep_vars and restrict_vars -- fixed "Sanday668","Sanday668" --> "Sanday668","Sanday669"

Press edit, copy, and paste to your own wiki page as follows, with XYZ = YOUR THREE INITIALS, Your dependent variable e.g., v242

  • Toward the bottom of the program change
 name<-"how society values children"
alias<-"DRWchildren"
to:
 name<-"Your topic phrase"
alias<-"XYZtopic"
  • Stage 2 Modifications to your own "CreateModelXYZv242.R" wiki page, with a copy of the contents of your "prototype"
  • Stage 3 Change the dependent variables, see if the program works
  • Stage 4 Change the independent variable

Stage 2 Modifications to your own prototype wiki page, e.g., "CreateModelXYZv242.R"

  1. You've made your own "CreateModelXYZv242.R" wiki page
  2. In your page, copy and paste: [[User:Your user name]]
  3. Above where you've copied contents of your prototype program
  4. Create a heading in your wiki page ==A Program CreateModelXYZv242.R== for your program
  5. In edit mode, copy contents of your page
  6. Use the slider on the wiki page, right side, to go to the bottom of the wiki page, and SAVE.
  7. Open R.
  8. Paste your program into into R.
  9. Report whether your program runs

Stage 3 Change the dependent variables and do test runs

  1. If your program didn't run, notify the instructor if you are in class or email him the address of your user page.
  2. If your program did run, you are ready to begin to change your program:
    1. First, change the dependent variable by substituting your variable number, e.g., v242, and remove any independent_variable that has that variable number, e.g., v242.
    2. Rerun your program. If it runs do item 1 in this stage 3. Once your program runs correctly, KEEP any independent_variables with pvalue <.15 and DROP any with pvalue equal or >.15. Rerun your program. If it runs do item 1 in this stage. Repeat. Now, in Stage 4 you can add independent_variables if needed.

Stage 4 Adding indep_vars

  1. Add an independent_variable as needed ONE AT A TIME, Repeating Stage 3.2.1 and 3.2.2. Continue if you have low R2.
  2. A GOOD RULE TO FOLLOW: when naming a new indep_var, use the wiki search window for the variable number, e.g., "v633." This will bring up the name previously used and help integrate your findings with others.

Stage 5

  • When you have a successful model, add an entry for it on this wiki page with the name of your Model in double square brackets.
  • If you need help from the instructor, add an entry for it on the Nonworking *Rccs* models wiki page and I will look at it

and help debug the errors that keep it from running.

Old method

If you've started the code for your project and it isn't working --> to get help

Copy the page with your code and your user name to Nonworking *Rccs* models

Variables names

  1. SCCS 2SLS Variable Names -- dont rely heavily on the WHYTE and the PAIGE variables because they code only half or less of the sample, which creates alot of probabilistic estimating of missing data.

General polygyny with more variables DRW

User:Doug White==
setwd("C:/My Documents/sccs")
library(sccs)
data(sccs)
source("examples/src/createmodelDRWpolygyny2.R") #define model, e.g., CreateModelDRWpolygyny2.R 
source("examples/src/CreateModelDRWpolygyny.R") #define model, e.g., CreateModelDRWpolygyny.R - CreateModelDRWpolygyny2.R" 
source("examples/src/run_model.R") #for model currently defined, does multiple imputation, 
*calls two stage ols and saves results to file to the working directory.
ols_stats$restrict_stats
ols_stats$r2
ols_stats$restrict_diagnostics

Value of children

Eff, E. Anthon, and Malcolm Dow. 2009. How to Deal with Missing Data and Galton's Problem in Cross-Cultural Survey Research: A Primer for R

setwd("C:/My Documents/sccs")
library(sccs)
data(sccs)
source("examples/src/CreateModelValueSDWchildren.R") #define model CreateModelValueSDWchildren.R
source("examples/src/run_model.R") #for model currently defined, does multiple imputation, 
*calls two stage ols and saves to file to the working directory.
ols_stats$restrict_stats
ols_stats$r2
ols_stats$restrict_diagnostics


General polygyny with few variables DRW

User:Doug White==
setwd("C:/My Documents/sccs")
library(sccs)
data(sccs)
source("examples/src/poly.R") 
source("examples/src/create_model_DRWpolygyny.R") #define model create_model_DRWpolygyny.R
source("examples/src/run_model.R") #for model currently defined, does multiple imputation, 
*calls two stage ols and saves results to file to the working directory.
ols_stats$restrict_stats
ols_stats$r2
ols_stats$restrict_diagnostics

Notes

WARNING: run_model.R will not work when you have a *.csv file open to check the last results but you dont need to do this because the output is printed to the screen by the ols_stats commands.
You will change the name of the .R file in the first line of the program and edit its contents
source("examples/src/create_model_XYZv242.R") #defines the model  
source("examples/src/run_model.R") #for model currently defined, does multiple imputation, 
*calls two stage ols and saves results to file to the working directory.
ols_stats$restrict_stats #these three commands print the output to the screen
ols_stats$r2
ols_stats$restrict_diagnostics
after source("examples/src/create_model_XYZv242.R") #defines the model  
source("sccs/R/two_stage_ols.R") #loads the new code into R but doesn't run anything yet until called by "run_model.R")

Multilevel peer effects and empirical causalities in the evolution of human societies.