Greetings, I am revisiting code from several different files I have saved from the past and all used to run flawlessly; now when I run any of the svyglm related functions, I am coming up with an error: Error in model.frame.default(formula = F3ATTAINB ~ F1PARED, data = data, : the ... list does not contain 4 elements The following is a minimal reproducible example: library(RCurl) library(survey) data <- getURL("https://raw.githubusercontent.com/cbenjamin1821/careertech-ed/master/elsq1adj.csv") elsq1ch <- read.csv(text = data) #Specifying the svyrepdesign object which applies the BRR weights elsq1ch_brr<-svrepdesign(variables = elsq1ch[,1:16], repweights = elsq1ch[,18:217], weights = elsq1ch[,17], combined.weights = TRUE, type = "BRR") elsq1ch_brr ##Resetting baseline levels for predictors elsq1ch_brr <- update( elsq1ch_brr , F1HIMATH = relevel(F1HIMATH,"PreAlg or Less") ) elsq1ch_brr <- update( elsq1ch_brr , BYINCOME = relevel(BYINCOME,"0-25K") ) elsq1ch_brr <- update( elsq1ch_brr , F1RACE = relevel(F1RACE,"White") ) elsq1ch_brr <- update( elsq1ch_brr , F1SEX = relevel(F1SEX,"Male") ) elsq1ch_brr <- update( elsq1ch_brr , F1RTRCC = relevel(F1RTRCC,"Other") ) ##Univariate testing for Other subset Othpared <- svyglm(formula=F3ATTAINB~F1PARED,family="quasibinomial",design=subset(elsq1ch_brr,BYSCTRL==1&G10COHRT==1&F1RTRCC=="Other"),na.action=na.omit) summary(Othpared)? Any help in resolving this concern would be greatly appreciated. Sincerely, Courtney Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenjami at btboces.org<mailto:cbenjami at btboces.org> 607-763-8633 [[alternative HTML version deleted]]
hi, i am not hitting an error when i copy and paste your code into a fresh console. maybe compare your sessionInfo() to mine? > sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods base other attached packages: [1] survey_3.32-1 survival_2.41-3 Matrix_1.2-10 RCurl_1.95-4.8 bitops_1.0-6 loaded via a namespace (and not attached): [1] compiler_3.4.1 splines_3.4.1 lattice_0.20-35 On Wed, Jul 5, 2017 at 2:24 PM, Courtney Benjamin <cbenjami at btboces.org> wrote:> Greetings, > > I am revisiting code from several different files I have saved from the > past and all used to run flawlessly; now when I run any of the svyglm > related functions, I am coming up with an error: > > Error in model.frame.default(formula = F3ATTAINB ~ F1PARED, data = data, : > the ... list does not contain 4 elements > The following is a minimal reproducible example: > library(RCurl) > library(survey) > > data <- getURL("https://raw.githubusercontent.com/ > cbenjamin1821/careertech-ed/master/elsq1adj.csv") > elsq1ch <- read.csv(text = data) > > #Specifying the svyrepdesign object which applies the BRR weights > elsq1ch_brr<-svrepdesign(variables = elsq1ch[,1:16], repweights > elsq1ch[,18:217], weights = elsq1ch[,17], combined.weights = TRUE, type > "BRR") > elsq1ch_brr > > ##Resetting baseline levels for predictors > elsq1ch_brr <- update( elsq1ch_brr , F1HIMATH = relevel(F1HIMATH,"PreAlg > or Less") ) > elsq1ch_brr <- update( elsq1ch_brr , BYINCOME = relevel(BYINCOME,"0-25K") ) > elsq1ch_brr <- update( elsq1ch_brr , F1RACE = relevel(F1RACE,"White") ) > elsq1ch_brr <- update( elsq1ch_brr , F1SEX = relevel(F1SEX,"Male") ) > elsq1ch_brr <- update( elsq1ch_brr , F1RTRCC = relevel(F1RTRCC,"Other") ) > > ##Univariate testing for Other subset > Othpared <- svyglm(formula=F3ATTAINB~F1PARED,family="quasibinomial" > ,design=subset(elsq1ch_brr,BYSCTRL==1&G10COHRT==1& > F1RTRCC=="Other"),na.action=na.omit) > summary(Othpared)? > > > Any help in resolving this concern would be greatly appreciated. > > Sincerely, > > Courtney > > > Courtney Benjamin > > Broome-Tioga BOCES > > Automotive Technology II Teacher > > Located at Gault Toyota > > Doctoral Candidate-Educational Theory & Practice > > State University of New York at Binghamton > > cbenjami at btboces.org<mailto:cbenjami at btboces.org> > > 607-763-8633 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
?Problem solved; I did not have the most updated version of R. When I updated it and ran the code, all worked well again. Thanks very much for helping me solve the mistake of an R novice! Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenjami at btboces.org<mailto:cbenjami at btboces.org> 607-763-8633 ________________________________ From: Anthony Damico <ajdamico at gmail.com> Sent: Wednesday, July 5, 2017 3:47 PM To: Courtney Benjamin Cc: r-help at r-project.org Subject: Re: [R] Svyglm Error hi, i am not hitting an error when i copy and paste your code into a fresh console. maybe compare your sessionInfo() to mine? > sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods base other attached packages: [1] survey_3.32-1 survival_2.41-3 Matrix_1.2-10 RCurl_1.95-4.8 bitops_1.0-6 loaded via a namespace (and not attached): [1] compiler_3.4.1 splines_3.4.1 lattice_0.20-35 On Wed, Jul 5, 2017 at 2:24 PM, Courtney Benjamin <cbenjami at btboces.org<mailto:cbenjami at btboces.org>> wrote: Greetings, I am revisiting code from several different files I have saved from the past and all used to run flawlessly; now when I run any of the svyglm related functions, I am coming up with an error: Error in model.frame.default(formula = F3ATTAINB ~ F1PARED, data = data, : the ... list does not contain 4 elements The following is a minimal reproducible example: library(RCurl) library(survey) data <- getURL("https://raw.githubusercontent.com/cbenjamin1821/careertech-ed/master/elsq1adj.csv") elsq1ch <- read.csv(text = data) #Specifying the svyrepdesign object which applies the BRR weights elsq1ch_brr<-svrepdesign(variables = elsq1ch[,1:16], repweights = elsq1ch[,18:217], weights = elsq1ch[,17], combined.weights = TRUE, type = "BRR") elsq1ch_brr ##Resetting baseline levels for predictors elsq1ch_brr <- update( elsq1ch_brr , F1HIMATH = relevel(F1HIMATH,"PreAlg or Less") ) elsq1ch_brr <- update( elsq1ch_brr , BYINCOME = relevel(BYINCOME,"0-25K") ) elsq1ch_brr <- update( elsq1ch_brr , F1RACE = relevel(F1RACE,"White") ) elsq1ch_brr <- update( elsq1ch_brr , F1SEX = relevel(F1SEX,"Male") ) elsq1ch_brr <- update( elsq1ch_brr , F1RTRCC = relevel(F1RTRCC,"Other") ) ##Univariate testing for Other subset Othpared <- svyglm(formula=F3ATTAINB~F1PARED,family="quasibinomial",design=subset(elsq1ch_brr,BYSCTRL==1&G10COHRT==1&F1RTRCC=="Other"),na.action=na.omit) summary(Othpared)? Any help in resolving this concern would be greatly appreciated. Sincerely, Courtney Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenjami at btboces.org<mailto:cbenjami at btboces.org><mailto:cbenjami at btboces.org<mailto:cbenjami at btboces.org>> 607-763-8633<tel:607-763-8633> [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]