search for: household

Displaying 20 results from an estimated 134 matches for "household".

2009 Jan 22
2
Converting ddf/dct/sas data definition file to R
Dear all, I was wondering whether anyone knows about a program which converts (part of) a data definition file (such as a .dct file for stata, or .sas file for sas) into an R-script. Here is an example with a .sas file: <-- snipp VALUE HTYPE (default=32) 0 = "Not in household" 1 = "Married couple family household" 2 = "Male householder family" 3 = "Female householder family" 4 = "Male householder nonfamily" 5 = "Female householder nonfamily&q...
2006 Apr 27
3
Removing a default value for a foreign key with not null set
Hi all, For various reasons I need to have foreign keys with not null constraints. Eg: create_table :people do |t| t.column :name, :string t.column :household_id, :integer, :null => false end create_table :households do |t| t.column :name, :string end add_foreign_key_constraint :people, :household_id, :households, :id So the people table has a foreign key into households (household_id), and not null is enabled on the column. My problem...
2003 Aug 20
1
query on converting survey data from one structure to another
Dear R users, I am trying to convert a dataset from one format to several rectangular datasets. A consultant helped design the data entry program for our survey using Delphi/Pascal and for each household the information is stored in a file called "EA-HM-HH.TXT" where EA is the enumeration area number, HM is the homestead number and HH is the household number. Within this file the data is stored as follows, ###### file="5677-001-001.TXT" ###### EAnumber=5677 HMnumber=001 HHn...
2008 Aug 12
1
Problem with using read.csv with web address
...oadTable=Download+this+table", sep="") x <- read.csv(url1, header = FALSE, stringsAsFactors = FALSE) I was expecting x to be like this: # because that's the structure I get if I download the file to my computer and then try to use read.csv() 1 Housing Stock (UV53) 2 3 4 All Household Spaces 5 Occupied Household Spaces 6 Unoccupied Household Spaces 7 Unoccupied Household Spaces: Second residence / holiday accommodation 8 Unoccupied Household Spaces: Vacant household space 9 Housing Stock (UV53), Apr01 10 Housing Stock (UV53), Apr01 11 Housing Stock (UV53) 12 This material is Cro...
2007 Oct 27
1
[non-statistics question]methodological problem
...1,1,2,2,1), Nhstrata=c(100,100,200,200,100), Nrmemb=c(2,4,2,5,4)) a$ocmemb1<-c("wk","jl","st","jl","st") a$ocmemb2<-c("wk","jl","st","wk","wk") where id_hh is a code of identification for the household (my analysis refers to households), strata is the strata from which the hh is sampled, Nhstrata is the dimension of the population strata from which the hh is sampled, nrmemb is the no of members in a hh and ocmemb1,2...is the occupation of each individual member of the hh (worker,jobless,student)....
2005 Jul 14
1
Single-table inheritance and eager loading
I have a people table with four types of people: clients, spouses, children, and others all setup using single-table inheritance with a foreign key back to a household record. A Household has_one client and spouse, and has_many children and others. I want to use a single "Household.find(@session [:household_id], :include => [:client, :spouse, :children, :others])" Unfortunately this generates the following error: "Not unique table/ alias:...
2007 Sep 07
1
R survey package again
Hi R-users!! I have some trouble with the survey pakage and i would be very glad if you can give me an advice. I have a sample from a survey where household were interviewed. The sample has 4 criteria on which the stratification was based: REGION, SIZE OF HOUSEHOLD, SIZE OF LOCALITY, AGE OF HEAD OF HOUSEHOLD. Since i don't have the whole information in each cell of the cross region*sizehh*sizeloc*age i can't use the postStratify function from S...
2006 Jun 20
3
Create variables with common values for each group
Dear all, sorry, this is for sure really basic, but I searched a lot in the internet, and just couldn't find a solution. The problem is to create new variables from a data frame which contains both individual and group variables, such as mean age for an household. My data frame: df hhid h.age 1 10010020 23 2 10010020 23 3 10010126 42 4 10010126 60 5 10010142 20 6 10010142 49 7 10010142 52 8 10010150 18 9 10010150 51 10 10010150 28 where hhid is the same number for each household, h.age the age for each ho...
2020 Oct 27
2
Creating unique code
Hello, I need some help in creating a new variable. I need to create a 'couple identifier', which gives a unique code for every couple/triple/... in a household. So, I can identify couples. To do this, I should use 4 variables: * SERIAL = a unique numeric code for each household * PERNUM = a unique numeric code for each person * SPLOC = the numeric code of the spouse in the household, it is equal to the PERNUM code of the spouse * SPRULE =...
2005 Oct 09
1
enter a survey design in survey2.9
...an area and rural one. there to region just with urbain area. stratification variable is a combinaison of region and area type (urban/rural) In rural area, subdivision are sample with probabilties proporionnal to size in population then enuration area are sample in selected division and finally households are selected in those EA. In urban area, EA are directly selected and finally household are selected. to schematise we have: (12 regions) each region is divised in two regions / Urbain and rural. this are strata in Rural : PSU are subdivision , SSU are EA and TSU are households...
2010 Aug 02
1
Any way around using only 1 render per action?
...o use a render in a controller action. The problem is that the action makes a user list and sends it to wicked_pdf, which uses a render, causing an error if I use one also. Does anyone know a way around this, and is the render I''m using totally necessary?? Here is my controller code. @households = Household.find(:all, :order => "last_name, first_name") @households.each { |@household| @today = Date.today @year = @today.year @thisyear = Visit.find_all_by_year_and_household_id(Date.today.year, @household.id) @lastyear = Visit.find_all_by_year_and_hous...
2002 Nov 14
1
analysis of data with observation weights
Dear R-users, Recently I had to analyze a dataset from household survey. The sample design ensured, that each household in the population has the same probability of being sampled. However the data were gathered from only one adult individual in each household, who was randomly choosen by an interviewer (via "Kish grid"). To equalize the probabilities...
2006 Nov 06
4
neg-bin clustered analysis in R?
Dear All, I'm analysing a negative binomial dataset from a population-based study. Many covariates were determined on household level, so all members of a household have the same value for those covariates. In STATA, there seems to be an option for 'clustered analysis' for neg-bin regression. Does an equivalent exist for R(MASS)'s glm.nb or a comparable function? Many thanks for all help! Lutz -- Lutz Ph. Bre...
2011 Oct 04
2
adding a dummy variable...
Hi all, I have a dataset of individuals where the variable ID corresponds to the identification of the household where the individual lives. rel.head stands for the relationship with the household head. so rel.head=1 is the household head, rel.head=2 is the spouse, rel.head=3 is the children. Here is an example to see how it looks like: df<-data.frame(ID=c("17100", "17100", "1710...
2010 May 26
3
error "variable names are limited to 256 bytes" when sourcing code
I've written a function that takes some input data output from a simulation model and creates some graphs. It's not very complicated code, and it works perfectly fine if I just run the code as is. But I have converted it into a function so we call it externally, and when I try to source the code to test the function, I get the error message "variable names are limited to 256
2012 Jan 24
0
PCA for assets based household income analysis (" hetcor" and "princomp")
I am doing Principal Component Analysis (PCA) on assets data for household income prediction. The problem is that the assets data are rank ordered (usually binary ... possess car/don't possess car), so the normal correlation is inappropriate for the calculation of the PCA. Instead one has to use the polychoric correlation coefficient. It uses the "random.polychor...
2012 Apr 17
1
random effects using lmer
Hi, I am trying to run a logistic regression to look at the risk of malaria infection in individuals. I want to account for intra household correlation and so want to include a household level random effect. I have been using the lmer command in lme4 package but am getting some strange results that are completely different to those I get using STATA. Can I just check that this is the correct code lmer(IsPos ~ Dist + (1 | HouseID), f...
2012 Apr 03
1
Compare by row and insert previous row value (Or non Time Series Lag)
I have the following sample dataset (CSV input here:http://goo.gl/YR8LP. CSV output here: http://goo.gl/EFCC8) which I want to transform as follows. For each person in a household I want to create two new variables OrigTAZ and DestTAZ. It should take the value in TripendTAZ and put that in DestTAZ. For OrigTAZ it should put value of TripendTAZ from the previous row. For the first trip of every person in a household (Tripid = 1) the OrigTAZ = hometaz. For each person in a hou...
2011 Oct 05
2
repeating categorical variable codes
I would appreciate help in knowing how to repeat categorical variable code given in column=A, by the number in a matching column=B. For example, I have a categorical variable code attributed to a household=A and want to replicate the code for all member of the household, as given in column=B. I would like to have one sequence of categorical variable codes for individuals in column C. I have ~9000 values in A and my C will be ~52000. E.g (A) (B) (C) 1 1 1 2 2 2 1...
2007 Oct 28
0
calibration question
...1,1,2,2,1), Nhstrata=c(100,100,200,200,100), Nrmemb=c(2,4,2,5,4)) a$ocmemb1<-c("wk","jl","st","jl","st") a$ocmemb2<-c("wk","jl","st","wk","wk") where id_hh is a code of identification for the household (my analysis refers to households), strata is the strata from which the hh is sampled, Nhstrata is the dimension of the population strata from which the hh is sampled, nrmemb is the no of members in a hh and ocmemb1,2...is the occupation of each individual member of the hh (worker,jobless,student)....