[R] Aggregation across two variables in data.table

2017-12-13 Thread Michael Haenlein
Dear all, I have a data.frame that includes a series of demographic variables for a set of respondents plus a dependent variable (Theta). For example: AgeEducation Marital Familysize IncomeHousingTheta 1: 50 Ass

[R] Speeding up npreg

2018-02-03 Thread Michael Haenlein
Dear all, I am using npreg from the np library to run a Kernel regression. My dataset is relatively large and has about 3000 observations. The dependent variable is continuous and I have a total of six independent variables -- two continuous, two ordinal and two categorical. The model converges w

[R] Fractional Factorial Design on 4-level factor

2016-05-31 Thread Michael Haenlein
n but it seems that this is only working for factors on two levels. Any idea how I could derive a fractional factorial design on factors with four levels? Thanks for your help, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version de

[R] lm model with many categorical variables

2016-09-20 Thread Michael Haenlein
Dear all, I am trying to estimate a lm model with one continuous dependent variable and 11 independent variables that are all categorical, some of which have many categories (several dozens in some cases). I am not interested in statistical inference to a larger population. The objective of my mo

[R] Teaching materials for R course

2015-02-03 Thread Michael Haenlein
) as well as (c) structural equation modelling. Are there any textbooks and teaching materials (e.g., PowerPoint slides) that one of you could recommend for me to have a look at? Thanks, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version deleted

[R] Running R Remotely on LINUX

2015-04-14 Thread Michael Haenlein
would be very appreciated! Thanks in advance, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

[R] Instagram Analysis

2018-09-25 Thread Michael Haenlein
Dear all, I'm looking for an R package that allows me to analyze Instagram. Specifically I would like to download for a given account the list of other accounts that either this account follows or that follow this account (the followers and following numbers). I know there is instaR but this pack

[R] Bayesian multivariate linear regression

2014-09-02 Thread Michael Haenlein
ate linear regression (e.g., bayesm), but those do not seem to have a prediction function. And the ones with prediction (e.g., MCMCPack) do not support multiple dependent variables. If you have any pointers, please let me know. Best wishes, Michael Michael Haenlein ESCP Europe Par

[R] igraph -- Selecting closest neighbors

2015-10-17 Thread Michael Haenlein
to do this in an efficient way? I have been trying to program something using ego () with varying levels of distance but I have not managed to get a conclusive solution. Thanks for your help, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version deleted

[R] Social Network Simulation

2016-04-16 Thread Michael Haenlein
, Michael Michael Haenlein Professor of Marketing ESCP Europe, Paris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] (Small) programming job related to network analysis

2016-04-19 Thread Michael Haenlein
and any other parameters those models require. In case this is of relevance please get in touch with me by email to discuss further details. Thanks, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version deleted]] _

[R] Simulate data from Structural Equation Model

2017-03-16 Thread Michael Haenlein
research, 32(4), 355 – 373), but I do not know whether some of these approaches have already been implanted in R and/ or whether better methods exist. Any help would be very much appreciated, Thanks, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version

[R] Help for programming a short code in R

2010-02-14 Thread Michael Haenlein
does not take very long -- although I cannot give a precise estimate of the number of hours required. If anyone is interested, please let me know and I can send you an electronic copy of the manuscript mentioned above. Best, Michael Michael Haenlein Professor of Marketing ESCP Europe -

[R] Convert character string to top levels + NAN

2010-04-22 Thread Michael Haenlein
). x_new should be equal to x for the top n categories (i.e. the top n levels with the highest occurrence) and NAN elsewhere. For example, for n=3 x_new would have three levels: The three most common levels of x + NAN. Is there some convenient way of doing this? Thanks in advance, Michael Michael

[R] Interpreting output of coxph with frailty.gamma

2010-04-26 Thread Michael Haenlein
in advance, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

[R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread Michael Haenlein
some automatic way in R through which this can be done? I tried a Kernel density estimation of the histogram but this does not seem to provide what I'm looking for. Thanks very much for your help, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Par

[R] predict.lm

2013-04-08 Thread Michael Haenlein
Dear all, I would like to use predict.lm to obtain a set of predicted values based on a regression model I estimated. When I apply predict.lm to two vectors that have the same values, the predicted values will be identical. I know that my regression model is not perfect and I would like to take a

[R] lp.transport in package lpSolve

2013-04-23 Thread Michael Haenlein
Dear all, I'm working on a very complex linear optimization problem using the lp.transport function in lpSolve. My PC has 10 cores, but by default R uses only one of them. Is there a straightforward way to make lp.transport use all cores available? I had a look at "High-performance and parallel c

[R] R in remote mode

2014-01-22 Thread Michael Haenlein
code and run it. Please let me know in case you have any ideas, Thanks in advance, Michael Michael Haenlein Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] boxcox alternative

2014-02-24 Thread Michael Haenlein
uot; but I wonder whether there are other options out there. Thanks, Michael Michael Haenlein Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] Looking for consultant in mathematics/ statistics

2013-12-03 Thread Michael Haenlein
take long (like a couple of hours), but I might be wrong. Looking forward to hearing from you, Michael Michael Haenlein Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Convert Mathematica code into R

2010-07-12 Thread Michael Haenlein
Dear all, I have a reasonably short piece of code written in Mathematica 5.2 which I would like to convert to R. The problem is that I'm not familiar with Mathematica. I would, however, also be OK with some interface that allows me to run Mathematica from within R and use the output of the Mathema

[R] Batch file export

2010-07-13 Thread Michael Haenlein
Dear all, I have a code that generates data vectors within R. For example assume: z <- rlnorm(1000, meanlog = 0, sdlog = 1) Every time a vector has been generated I would like to export it into a csv file. So my idea is something as follows: for (i in 1:100) { z <- rlnorm(1000, meanlog = 0, sdlo

[R] Printing status updates in while-loop

2010-07-14 Thread Michael Haenlein
Dear all, I'm using a while loop in the context of an iterative optimization procedure. Within my while loop I have a counter variable that helps me to determine how long the loop has been running. Before the loop I initialize it as counter <- 0 and the last condition within my loop is counter <-

[R] Import graph object

2010-07-14 Thread Michael Haenlein
Dear all, I have a txt file of the following format that describes the relationships between a network of a certain number of nodes. {4, 2, 3} {3, 4, 1} {4, 2, 1} {2, 1, 3} {2, 3} {} {2, 5, 1} {3, 5, 4} {3, 4} {2, 5, 3} For example the first line {4, 2, 3} implies that there is a connection betw

[R] Consultant for Mathematica -> R translation

2010-07-20 Thread Michael Haenlein
Dear all, I have a very short code written in Mathematica which I would need to get translated for use in R. I'm not an expert in Mathematica (which is why I would not feel comfortable with doing the translation myself), but the code is very short (probably 30-40 lines) and looks quite simple fro

[R] Equivalent to go-to statement

2010-07-24 Thread Michael Haenlein
Dear all, I'm working with a code that consists of two parts: In Part 1 I'm generating a random graph using the igraph library (which represents the relationships between different nodes) and a vector (which represents a certain characteristic for each node): library(igraph) g <- watts.strogatz.g

[R] Time-dependent covarites in survreg function

2010-07-26 Thread Michael Haenlein
Dear all, I'm doing a survival analysis with time-dependent covariates. Until now, I have used a simple Cox model for this, specifically the coxph function from the survival library. Now, I would like to try out an accelerated failure time model with a parametric specification as implemented for e

[R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
but I have to admit that I'm a bit lost here. Could anyone give me some advice on how this could be done? Thanks very much in advance, Michael Michael Haenlein Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] ___

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
e hazard > has to be computed and it is not straightforward since it is implicit > in the Cox model. > > 2010/11/11 David Winsemius : > > > > On Nov 11, 2010, at 3:44 AM, Michael Haenlein wrote: > > > >> Dear all, > >> > >> I'm struggli

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
able rather than a dichotomous outcome ( > 0=alive, 1=death). You can accomplish this with a straight forward > regression analysis. > > Best, > > Jim > > On Thu, Nov 11, 2010 at 3:44 AM, Michael Haenlein > wrote: > >> Dear all, >> >> I'm struggling

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread Michael Haenlein
; On Nov 11, 2010, at 12:14 PM, Michael Haenlein wrote: > > Thanks for the comment, James! >> >> The problem is that my initial sample (Dataset 1) is truncated. That means >> I >> only observe "time to death" for those individuals who actually died

[R] Time-dependent covariates in survreg function

2010-07-28 Thread Michael Haenlein
time-dependent covariates, is there a similar function in some other package that can? Thanks very much, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-proj

[R] Collinearity in Moderated Multiple Regression

2010-08-03 Thread Michael Haenlein
del <- lm (y ~ x1 + x2 + x1*x2) summary(model) Is there some function within R or in some separate library that allows me to estimate such a regression without obtaining inconsistent results? Thanks for your help in advance, Michael Michael Haenlein Associate Professor of Marketing ESCP Europ

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-03 Thread Michael Haenlein
> Nikhil Kaza > Asst. Professor, > City and Regional Planning > University of North Carolina > > nikhil.l...@gmail.com > > > On Aug 3, 2010, at 9:10 AM, Michael Haenlein wrote: > > Dear all, >> >> I have one dependent variable y and two independe

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-03 Thread Michael Haenlein
number you deem surprising. >> (I got values between 0.2 and 0.4 on several runs. > > > >> Try: > >> x1 >> x2 >> x3 > > >> y >> model >> summary(model) > > > >> # Multiple R-squared: 0.04269 > > > >> -- > >>

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-03 Thread Michael Haenlein
to my previous message, > > > > Michael > > > > > > > > > > > > > > On Aug 3, 2010 3:42pm, David Winsemius wrote: > > > I think you are attributing to "collinearity" a problem that is > > > due to your small sam

[R] Aggregating data from two data frames

2010-09-08 Thread Michael Haenlein
Dear all, I'm working with two data frames. The first frame (agg_data) consists of two columns. agg_data[,1] is a unique ID for each row and agg_data[,2] contains a continuous variable. The second data frame (geo_data) consists of several columns. One of these columns (geo_data$ZCTA) corresponds

[R] Total effect of X on Y under presence of interaction effects

2011-05-11 Thread Michael Haenlein
s to get a total effect of a on y? Or am I doing something wrong here? Thanks very much for your answer in advance, Regards, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France Call: lm(formula = y ~ a * b * c * d) Residuals: Min 1Q Median

[R] Powerful PC to run R

2011-05-13 Thread Michael Haenlein
, Michael Michael Haenlein Assocaite Professor of Marketing ESCP Europe Paris, France [[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 ht

[R] Help to improve existing R-Code

2011-05-27 Thread Michael Haenlein
an experienced programmer the job should not take more than 2-3 days (probably less), but this is to be decided once the person has looked at the code. In case you are interested, please send me a brief message so that I can provide you with more details, Thanks, Michael Michael Haenlein

Re: [R] Help to improve existing R-Code

2011-05-27 Thread Michael Haenlein
I'm looking to hire someone -- sorry for not having been more precise! Michael On Fri, May 27, 2011 at 1:23 PM, Duncan Murdoch wrote: > On 11-05-27 3:23 AM, Michael Haenlein wrote: > >> Dear all, >> >> I have written a relatively brief R-Code to run a series of simul

[R] System of related regression equations

2011-02-22 Thread Michael Haenlein
that appear in Equation 1 are also included in Equation 2. I assume that I cannot estimate these two regressions separately using lm. Is there an efficient way to estimate these equations? Thanks very much in advance, Michael Michael Haenlein Professor of Marketing ESCP Europe Paris, France

[R] Effect size in multiple regression

2011-03-26 Thread Michael Haenlein
do it manually. Thanks, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

[R] Testing equality of coefficients in coxph model

2011-04-12 Thread Michael Haenlein
nd x2 are constraint to be equal and to compare the fit of such a constraint model with the one of an unconstraint one. But again I'm not sure how this can be done using coxph. Could anyone help me out on this please? Thanks, Michael Michael Haenlein Associate Professor of Marketing E

[R] Allocation of data points to groups based on membership probabilities

2011-09-15 Thread Michael Haenlein
know how. Does anyone have an idea how this could be done? Thanks very much in advance, Michael Haenlein Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Binary optimization problem in R

2011-09-19 Thread Michael Haenlein
eciated! Thanks very much in advance, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] Cannot allocate vector of size x

2011-09-21 Thread Michael Haenlein
Dear all, I am running a simulation in which I randomly generate a series of vectors to test whether they fulfill a certain condition. In most cases, there is no problem. But from time to time, the (randomly) generated vectors are too large for my system and I get the error message: "Cannot alloca

[R] Help with estimating copulas

2011-06-29 Thread Michael Haenlein
take more than a couple of hours, one day maximum. Please contact me in case you are interested so that I can provide you with additional details on the problem I'd like to solve. Thanks, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[altern

[R] Convert continuous variable into discrete variable

2011-07-15 Thread Michael Haenlein
Dear all, I have a continuous variable that can take on values between 0 and 100, for example: x<-runif(100,0,100) I also have a second variable that defines a series of thresholds, for example: y<-c(3, 4.5, 6, 8) I would like to convert my continuous variable into a discrete one using the thres

[R] Regression model when dependent variable can only take positive values

2011-12-06 Thread Michael Haenlein
Dear all, I would like to run a regression of the form lm(y ~ x1+x2) where the dependent variable y can only take positive values. Assume, for example, that y is the height of a person (measured in cm), x1 is the gender (measured as a binary indicator with 0=male and 1=female) and x2 is the age of

[R] Extract BIC for coxph

2011-12-20 Thread Michael Haenlein
Dear all, is there a function similar to extractAIC based on which I can extract the BIC (Bayesian Information Criterion) of a coxph model? I found some functions that provide BIC in other packages, but none of them seems to work with coxph. Thanks, Michael [[alternative HTML version de

[R] Pearson correlation of sum of variables

2011-09-25 Thread Michael Haenlein
Dear all, this is more a math-related question, but probably can help me nevertheless: Assume I have two random variables: A and B. Furthermore assume that I know the Pearson Correlation Coefficient between A and B: cor(A,B) I now define C = 1-(A+B). Is there some way to determine cor(C,A) and c

[R] Pearson chi-square test

2011-09-27 Thread Michael Haenlein
Dear all, I have some trouble understanding the chisq.test function. Take the following example: set.seed(1) A <- cut(runif(100),c(0.0, 0.35, 0.50, 0.65, 1.00), labels=FALSE) B <- cut(runif(100),c(0.0, 0.25, 0.40, 0.75, 1.00), labels=FALSE) C <- cut(runif(100),c(0.0, 0.25, 0.50, 0.80, 1.00), labe

Re: [R] Pearson chi-square test

2011-09-27 Thread Michael Haenlein
ember 2011 17:00 To: Michael Haenlein; r-help@r-project.org Subject: RE: [R] Pearson chi-square test Just for completeness: the manual calculation you'd want is most likely sum((x-y)^2 / (x+y)) (that's one you can find on the Wikipedia link you provided). To get the same from ch

[R] Time-dependent covariates in coxph model

2011-10-07 Thread Michael Haenlein
Dear all, I have a question about time-dependent covariates in a coxph model. Specifically I am wondering whether it is possible to give more recent events a higher weight when constructing time-dependent covariates. Assume I have a sample of cancer patients and I would like to predict whether th

[R] Curve fitting, probably splines

2012-04-12 Thread Michael Haenlein
Dear all, This is probably more related to statistics than to [R] but I hope someone can give me an idea how to solve it nevertheless: Assume I have a variable y that is a function of x: y=f(x). I know the average value of y for different intervals of x. For example, I know that in the interval[0

[R] Consultant to program R-code dealing with social networks

2012-01-30 Thread Michael Haenlein
about the remaining details. Thanks, Michael Michael Haenlein Associate Professor of Marketing ESCP Europe Paris, France [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Regression with very high number of categorical variables

2012-05-08 Thread Michael Haenlein
Dear all, I would like to run a simple regression model y~x1+x2+x3+... The problem is that I have a lot of independent variables (xi) -- around one hundred -- and that some of them are categorical with a lot of categories (like, for example, ZIP code). One straightforward way would be to (a) tran