Re: [R] Classification Tree Prediction Error

2020-08-25 Thread Xu Jun
Breathed in his "Bloom County" comic strip ) > > > On Mon, Aug 24, 2020 at 8:58 AM Xu Jun wrote: > >> Dear all R experts, >> >> I have a question about using cross-validation to assess results estimated >> from a classification tree model. I annotated

[R] Classification Tree Prediction Error

2020-08-24 Thread Xu Jun
Dear all R experts, I have a question about using cross-validation to assess results estimated from a classification tree model. I annotated what each line does in the R code chunk below. Basically, I split the data, named usedta, into 70% vs. 30%, with the training set having 70% and the test set

Re: [R] multilevel binary and ordered regression models

2013-06-09 Thread Xu Jun
latively large data set, but is there any way to speed up the estimation a bit. Thanks a lot! Jun On Fri, Jun 7, 2013 at 1:04 AM, Rune Haubo wrote: > On 6 June 2013 00:13, Xu Jun wrote: >> Dear r-helpers, >> >> I have two questions on multilevel binary and ordered regressi

[R] multilevel binary and ordered regression models

2013-06-05 Thread Xu Jun
Dear r-helpers, I have two questions on multilevel binary and ordered regression models, respectively: 1. Is there any r function (like lmer or glmer) to run multilevel ordered regression models? 2. I used the glmer function to run a two-level binary logit model. I want to make sure that I did i

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Xu Jun
onsulting with a > local statistician/R expert who would help you with a major rewrite of > your code. > > But ... note my disclaimer again at the top. > > Cheers, > Bert > > On Wed, Aug 1, 2012 at 2:34 PM, Xu Jun wrote: >> Thanks Michael. No

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Xu Jun
te I know there is something wrong with the way that I set up my initial values, but just couldn't figure out how. Any help would be greatly appreciated! Jun On Tue, Jul 31, 2012 at 10:07 PM, R. Michael Weylandt wrote: > On Tue, Jul 31, 2012 at 7:57 PM, Xu Jun wrote: >> Dear R li

[R] optim() for ordered logit model with parallel regression assumption

2012-07-31 Thread Xu Jun
Dear R listers, I am learning the MLE utility optim() in R to program ordered logit models just as an exercise. See below I have three independent variables, x1, x2, and x3. Y is coded as ordinal from 1 to 4. Y is not yet a factor variable here. The ordered logit model satisfies the parallel regre

[R] read in Stata and SPSS with value labels/formats

2012-01-19 Thread Xu Jun
Sorry I forgot the subject line last time Dear R experts, I am using the foreign package to read in Stata and SPSS format data files (same data but I tried different format). I first tried using read.dta for the Stata format: ## > library(foreign) > mystata <- read.dta("

[R] loops over regression models

2012-01-13 Thread Xu Jun
Dear R help listers, I am trying to replicate results in Gelman and Hill's book (Chapter 3 in regressions and multilevel models). Below I estimated two models (chp3.1 and chp3.3 in R codes) with the same data and dependent variable but different independent variables. I have been using Stata for q

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
Dear Prof. Fox, I just picked up R not long ago, and apologize that I am not that familiar with some basics. I am trying to replicate what I can do with Stata in R. Thanks for all your help! On Thu, Oct 20, 2011 at 2:47 PM, John Fox wrote: > Dear Xu Jun, > > On Thu, 20 Oct 2011 14:41

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
hat makes graphing so much easier. Jun On Thu, Oct 20, 2011 at 11:55 AM, John Fox wrote: > Dear Xu Jun, > > I'm not sure whether this is the source of the error, but it may help to > spell the xlevels argument correctly (it is not

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
will keep working on the codes and see if I can figure out. Again, your effects package, I have to say, is awesome! Jun On Thu, Oct 20, 2011 at 1:26 PM, Xu Jun wrote: > Dear Professor Fox, > > Thanks a lot! That is an embarrassing error. After I cleaned up and > simplified my codes, and

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
or in evaluating the argument 'x' in selecting a method for function 'plot': Error in model.frame.default(formula = factor(warm) ~ yr89 + male + white + : variable lengths differ (found for 'yr89') On Thu, Oct 20, 2011 at 11:55 AM, John Fox wrote: > Dear Xu Ju

[R] effect function in the effects package

2011-10-20 Thread Xu Jun
Dear r-help listers, I am using effects to produce an effect plot after the proportional odds logistic regression model. There is no problem for me to estimate the model, but when it comes to the graphing, I was stuck. see the codes below: #

[R] hypothetical prediction after polr

2011-10-18 Thread Xu Jun
Dear R-Help listers, I am trying to estimate an proportional odds logistic regression model (or ordered logistic regression) and then make predictions by supplying a hypothetical x vector. However, somehow this does not work. I guess I must have missed something here. I first used the polr functio

[R] effects package for adjusted predictions

2011-05-13 Thread Xu Jun
Dear R experts, I am trying to use John Fox's effects package to conduct some post-estimation analysis.  I think it is a great package for graphing predictions after GLM type models.  However, I am having problems figuring out how to produce an adjusted mean.  For example, using the following two

[R] get adjusted means using the effects package

2011-05-12 Thread Xu Jun
Dear R experts, I am trying to use John Fox's effects package to conduct some post-estimation analysis. I think it is a great package for graphing predictions after GLM type models. However, I am having problems figuring out how to produce an adjusted mean. For example, using the following two

Re: [R] wireframe 3-D problems

2009-05-17 Thread Xu Jun
Ben, Thank you for your help! Jun [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide c

[R] wireframe 3-D problems

2009-05-16 Thread Xu Jun
Dear All R Users, I am trying to graph a 3-D graph of simulated data for logit models using the powerful wireframe command, but I got stuck. Here are the codes: x <- seq(-4, 4, by=0.01) y <- seq(-4, 4, by=0.01) p <- 1/(1+exp(-0.12*x + 0.35*y)) mydata <- cbind(x, y, p) require(lattice) wirefr

[R] latent class analysis of nominal and continuous indicators

2008-11-05 Thread Xu Jun
Dear R-help listers, I am a new convert to R. I am trying to use a r package to conduct latent class analysis as a triangulation check of my cluster analysis using the cluster package in R. I have about 30 cases and 6 indicators, some of which are binary indicators and others are ratio-level varia

[R] Latent Structure Analysis

2008-10-03 Thread Xu, Jun
Dear R-Listers, I have several ratio (percentages) and binary indicators, and I'd like to use these indicators to recover several latent classes based on these percentage (expenses over GDP) and binary measures. Any type of statistical analysis is suited for such data and is there a R-package a