Displaying 9 results from an estimated 9 matches for "nhis".
Did you mean:
his
2012 Oct 02
2
svyby and make.formula
....510514 0 2 2 339 1429.5963 1"
newdata <- read.table (textConnection(xd1), header=TRUE, as.is=TRUE)
dim (newdata)
# make the grouping variable (xspd)2
newdata$xspd2 <- factor(newdata$xspd2,levels=c (1,2),labels=c('SPD', 'No SPD'), ordered=TRUE)
nhis <- svydesign (id=~psu,strat=~stratum, weights=~wt8, data=newdata, nest=TRUE)
# mean age at death - nationwide
svymean( ~dthage, data=nhis , subset (nhis, mortstat==1))
# mean by SPD status
svyby(~dthage, ~xspd2 , design=nhis, svymean )
#percentile
svyquantile(~dthage, data = nhis , sub...
2003 Feb 12
2
Various Errors using Survey Package
Hi,
I have been experimenting with the new Survey package. Specifically, I was
trying to use some of the functions on the public-use survey data from NHIS
(2000 Sample Adult file).
Error 1): The first error I get is when I try to specify the complex survey
design.
nhis.design<-svydesign(ids=~psu, probs=~probs, strata=~strata, data=nhis.df,
check.strata=TRUE)
Error in svydesign(ids = ~psu, probs = ~probs, strata = ~strata, data =
nhis.df, :...
2012 Oct 14
2
svyhist and svyboxplot
...RUE)
# Grouping variable "xsmoke" must be a factor
tor$xsmoke <- factor(tor$xsmoke,levels=c (1,2,3),
labels=c('Current SMK','Former SMK', 'Never Smk'), ordered=TRUE)
is.factor(tor$xsmoke)
# object with survey design variables and data
nhis <- svydesign (id=~psu,strat=~stratum, weights=~wt8, data=tor, nest=TRUE)
MyBreaks <- c(18, 25, 35, 45, 55, 65, 75, 85)
par(mfrow=c(2,2))
#Chart 1
options( survey.lonely.psu = "adjust" )
svyhist (~age_p,
subset (nhis, xsmoke=='Current SMK'), breaks=MyBreaks,...
2007 Oct 28
1
tree problem
...= No)
educ Education Recode (1 = HS, GED, or less, 5 = some college, 6 =
Bachelor's or AA degree, 9 = Master's & higher
Here are 2 calls to tree and a snip of summary results:
### Use a sample of 100 ####
> set.seed(331)
> nsize = 100
> sam <- sample(1:nrow(nhis), nsize)
>
> t1 <- tree( RESP ~ AGE_P + ORIGIN_I + RACRECI2 + parents + educ,
+ method = "class",
+ control = tree.control(nobs = nsize, minsize = 10),
+ data = nhis[sam,])
> summary(t1)
Classification tree:
tree(formula = RESP ~ AGE_P + ORIGIN_I + RACREC...
2012 Oct 05
1
svyhist
...39;, as.is=TRUE)
# Grouping variable (xspd) to be factor
tor <- within(tor, {
xspd2 <- factor(xspd2,levels=c (1,2),
labels=c('SPD', 'No SPD'), ordered=TRUE)
}
)
# object with survey design variables and data
nhis <- svydesign (id=~psu,strat=~stratum, weights=~wt8, data=tor, nest=TRUE)
MyBreaks <- c(18,35,45,55,65,75,85,95)
png("svyhist_age_at_death.png")
svyhist (~dthage,
subset (nhis, xspd2==2), breaks=MyBreaks, main= " ",
col="grey80",...
2008 Aug 25
4
R for Windows GUI closes when I try to read.spss
...t 5 or 6 by now) I get the following Microsoft error
message and the R-Console crashes.
R for Windows GUI front-end has encountered a problem and needs to
close. We are sorry for the inconvenience.
I would greatly appreciate help with this as we need to use R to
estimate confidence intervals for NHIS data, and our deliverable is due
this week.
Thanks in advance.
2003 Feb 19
5
Subpopulations in Complex Surveys
Hi,
is there a way to analyze subpopulations (e.g. women over 50, those who
answered "yes" to a particular question) in a survey using Survey package?
Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option to
identify the subpopulation for which the analysis shoud be done. I did not
see this option in the Survey package. Is there another way to do this?
2012 Oct 01
3
merge.zoo returns unmatched dates
Sorry for the lack of reproducible data, but this seems to be a problem inherent to my dataset and I can't figure out where the issue is.
I have several data frames set up as a time series with identical POSIXct date formats. If I keep the original data in data frame format and merge them using base merge- everything is perfect and everyone is happy.
If I transform the data frames to zoo
2012 Nov 13
5
Getting information encoded in a SAS, SPSS or Stata command file into R.
Dear folks ?
I have a large (26 gig) ASCII flat file in fixed-width format with about 10
million observations of roughly 400 variables. (It is 51 years of Current
Population Survey micro data from IPUMS, roughly half the fields for each
record). The file was produced by automatic process in response to a data
request of mine.
The file is not accompanied by a human-readable file giving the