Re: [R] Elements of Sets as dataframe column names

2018-03-19 Thread Bert Gunter
You have failed to tell us that you are using a package, presumably the sets package. What I believe you don't understand is that the underlying data structures that represent sets are not what you think they are, but behave as you expect through the package API. So unless the API gets you the

[R] Elements of Sets as dataframe column names

2018-03-19 Thread Neha Aggarwal
Hello all, I have a set B and a dataframe df. I want to name the columns of the dataframe after the elements of the set B. For example, for set B with elements {{"P1"}, {"P2"}, {"P3", "P4"}} I want to create a new dataframe with 3 columns named {"P1"} and {"P2"} and {"P3","P4"}. I tried

Re: [R] Struggling to compute marginal effects !

2018-03-19 Thread Jim Lemon
In that case, I can't work out why the first model fails but not the second. I would start looking at "Data" to see what it contains. if: object2 <- polr(Inc ~ Training ,Data,Hess = T,method = "logistic" ) works, the problem may be with the "Adopt" variable. Jim On Tue, Mar 20, 2018 at 10:55

Re: [R] Struggling to compute marginal effects !

2018-03-19 Thread Jim Lemon
Hi Willy, The error message may be due to passing an inappropriate environment. I don't have the "erer" package, but if that function has a default for the environment argument, perhaps passing just the "predvars" and "data" arguments will work. Jim On Tue, Mar 20, 2018 at 8:24 AM, Willy

Re: [R] Struggling to compute marginal effects !

2018-03-19 Thread Bert Gunter
You are more likely to get a useful answer if you read **and follow** the posting guide linked below. In particular, show us the code that elicited the error. A small reproducible example would be even better, though may not be needed. Cheers, Bert Bert Gunter "The trouble with having an open

[R] Struggling to compute marginal effects !

2018-03-19 Thread Willy Byamungu
Dear Oscar, and any other R-project person, Can you please help me to figure out the meaning of the following error message in red ? Error in eval(predvars, data, env) : numeric 'envir' arg not of length one I computed ordered logit models using 'polr' in R (I just followed the guidance a

Re: [R] Labelling a fortified GADM map plotted with ggplot and geom_map

2018-03-19 Thread Bert Gunter
The r-sig-geo list, https://stat.ethz.ch/mailman/listinfo/r-sig-geo is often a better place to post such geographically related queries. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley

[R] Labelling a fortified GADM map plotted with ggplot and geom_map

2018-03-19 Thread Kenneth Dyson
I am having trouble getting data labels to display over the provinces in a GADM map of Canada. Specifically, I need the variable "Number" from the data set "by_province", grouped by "region", to appear on the corresponding regions of the map. The data set "by_province" looks like this: long

Re: [R] help needed on RcppEigen....

2018-03-19 Thread Jeff Newmiller
For loops are not usually the primary cause of slow processing in R... poor memory handling is. But the closest you seem to come to asking a question in your email seems to be about Rcpp, which is off topic on this mailing list. Try reading all of the Rcpp vignettes, and then if needed ask on

Re: [R] How to Find the value of r-square change in hierarchical multiple linear regression

2018-03-19 Thread S Ellison
> I'd like to find the value of r-square change at each step of a regression > model. > > I know that I can use anova () to compare to models, but, if I want to find > out > that how much exactly r-square has change from one model to the next, how > can I find that? See ?summary.lm For a

Re: [R] Set Difference Problem

2018-03-19 Thread S Ellison
First, it _looks_ like you're not constructing your starting sets properly. The sets package manual says that the set constructor is set() There's no apparent overload for {} Assuming your actual commands are x<- set("P1", "P2", "P3", "P4") y<-set() There's a difference between z<-set(x,y).

Re: [R] selectFGR - variable selection in fine gray model for competing risks

2018-03-19 Thread Thomas Alexander Gerds
Dear Raja the technical problem is that the function crrstep does not communicate the selected variables in a proper way. the function pec::selectFGR uses rownames(crrstep.fit$coefficients). the other problem is that I don't like and never use backward elemination -- so, I am not motivated to fix