similar to: Need help with my R- Project

Displaying 20 results from an estimated 8000 matches similar to: "Need help with my R- Project"

2023 Nov 03
1
[EXTERNAL] RE: I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Yes, that will halve the number of multiplications. If you?re looking for such optimisations then you can also consider ifelse(G=='male', 65L, 58L). That will definitely use less time & memory if WC is integer, but the trade-offs are more complicated if WC is floating point. Regards, Jorgen Harmse. From: avi.e.gross at gmail.com <avi.e.gross at gmail.com> Date: Friday,
2023 Nov 03
2
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Just a minor point in the suggested solution: df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG)) since WC and TG are not conditional, would this be a slight improvement? df$LAP <- with(df, TG*(WC - ifelse(G=='male', 65, 58))) -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of Jorgen Harmse via R-help Sent: Friday,
2006 Jun 28
1
Simulate dichotomous correlation matrix
Newsgroup members, Does anyone have a clever way to simulate a correlation matrix such that each column contains dichotomous variables (0,1) and where each column has different prevalence rates. For instance, I would like to simulate the following correlation matrix: > CORMAT[1:4,1:4] PUREPT PTCUT2 PHQCUT2T ALCCUTT2 PUREPT 1.0000000 0.5141552 0.1913139 0.1917923 PTCUT2
2023 Nov 03
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG)) That will do both calculations and merge the two vectors appropriately. It will use extra memory, but it should be much faster than a 'for' loop. Regards, Jorgen Harmse. ------------------------------ Message: 8 Date: Fri, 3 Nov 2023 11:10:49 +1030 From: "Md. Kamruzzaman" <mkzaman.m at gmail.com>
2008 Nov 20
1
classification accuracy in logistic regression
Hi all, I'm looking for a program that will take the predicted probabilities from a logistic regression using glm{stats}, dichotomize them according to a threshold that I can control, and then use them to form sensitivity, specificity, false pos and false neg rates. Thanks in advance. David -- ======================================================================= David Kaplan, Ph.D.
2011 Jun 21
1
working with sparse matrix
Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it. Under sna package I have found event2dichot yet it doesnt recognize sparse matrix and requires adjacency matrix or array. I tried to run a simple loop code for (i in 1:500) for (j in 1:53380) if (matrix[i,j]>0) matrix[i,j]=1 yet this takes a lot of time to run, I mean it has been last two hours and it is stil running.
2023 Nov 05
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
There are many techniques Callum and yours is an interesting twist I had not considered. Yes, you can specify what integer a factor uses to represent things but not what I meant. Of course your trick does not work for some other forms of data like real numbers in double format. There is a cost to converting a column to a factor that is recouped best if it speeds things up multiple times. The
2023 Nov 04
2
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
I might have factored the gender. I'm not sure it would in any way be quicker. But might be to some extent easier to develop variations of. And is sort of what factors should be doing... # make dummy data gender <- c("Male", "Female", "Male", "Female") WC <- c(70,60,75,65) TG <- c(0.9, 1.1, 1.2, 1.0) myDf <- data.frame( gender, WC, TG ) #
2023 Nov 06
0
I need to create new variables based on two numeric variables and one dichotomize conditional category
Avi: Thank you for checking. I think the optimization is limited. If test is all TRUE or all FALSE then at most one vector is evaluated. Anything beyond that would be very complicated. (Inspect the two expressions and verify that both specify elementwise computations. Then use indexing to shrink the input properly. Take into account all recycling rules for binary operations.) > ifelse(0:1,
2001 Aug 16
1
new to R: question about nlme
Hi all, I am a PhD student in sociology, studying in Essen, Germany. I am doing an empirical research with data on three (hierarchical) levels: Individuals within schools within regions. The data are very sparse with a lot of schools containing only one individual. In addition the dependent variable is dichotomous, so that a logistic regression would be appropriate. There are independent variables
2007 Jun 16
1
selecting cut-off in Logistic regression using ROCR package
Hi, I am using logistic regression to classify a binary psychometric data. using glm() and then predict.glm() i got the predicted odds ratio of the testing data. Next i am going to plot ROC curve for the analysis of my study. Now what i will do: 1. first select a cut-off (say 0.4) and classify the output of predict.glm() into {0,1} segment and then use it to draw ROC curve using ROCR package
2010 Jun 03
2
Comparing a 4-point and 5-point Likert scale
Help with survey data: Hello R colleagues, I hope this is an appropriate place to direct this question. It relates specifically to the comparability of a 5-point likert to a 4- point likert scale. One question in my dataset asks "How much should be done to reduce the gap between rich and poor" Much more, somewhat more, about the same, somewhat less and much less. The second
2005 Apr 03
4
Generating a binomial random variable correlated with a normal random variable
Hi All: I would like to generate a binomial random variable that correlates with a normal random variables with a specified correlation. Off course, the correlation coefficient would not be same at each run because of randomness. I greatly appreciate your input. Ashraf
2005 Sep 27
1
Simulate phi-coefficient (correlation between dichotomous vars)
Newsgroup members, I appreciate the help on this topic. David Duffy provided a solution (below) that was quite helpful, and came close to what I needed. It did a great job creating two vectors of dichotomous variables with a known correlation (what I referred to as a phi-coefficient). My situation is a bit more complicated and I'm not sure it is easily solved. The problem is that I must
2012 Jan 26
2
How do I use the cut function to assign specific cut points?
I am new to R, and I am trying to cut a continuous variable BMI into different categories and can't figure out how to use it. I would like to cut it into four groups: <20, 20-25, 25-30 and >= 30. I am having difficulty figuring the code for <20 and >=30? Please help. Thank you. -- View this message in context:
1999 Jan 12
13
Access denied
Hello, Samba 1.9.16p11 on Sun OS 5.6 For a NT4 Server SP4, I can not access to the samba server. When I look at the log.MachineName file, I see the error "password server not avalaible". I must say that it is working fine with an NT4 SP4 server on the same domain with the same user account. I have change the registry to authorize non-encrypted password. ...... Thanks. --
2008 Aug 06
1
Correlation dichotomous factor, continous (numerical) and ordered factor
Hello R-User! I appologise in advance if this should also go into statistics but I am presently puzzled. I have a data.frame (about 300 rows and about 80 variables) and my variables are dichotomous factors, continuous (numerical) and ordered factors. I would like to calculate the linear correlation between every pair of my variables, because I would like to perform a logistic regression (glm())
2016 Apr 16
2
Problem: No p-value for a point-baserial correlation with R
Dear community I'm pretty new to R and I'm trying to do a Point-baserial correlation for a nominal dichotomous variable with a interval scaled variable. It works fine, but the output just shows me the correlation and nothing else (p-Value would be important). I tried it with the following codes: - biseral.cor() - cor.biseral() - I also tried a polyserial() I've found on this
2009 Dec 29
0
[LLVMdev] "Graphite" for llvm
Tobias Grosser wrote: > The way to go is the scoplib format (propably extended by quantified > variables). This format could be extracted from graphite easily and > could also be created in LLVM. > What we need to get back into LLVM is only the new optimized schedule > described e.g. as cloog like scattering functions. These can be parsed > easily. The real code generation
2007 Aug 07
2
GLMM: MEEM error due to dichotomous variables
I am trying to run a GLMM on some binomial data. My fixed factors include 2 dichotomous variables, day, and distance. When I run the model: modelA<-glmmPQL(Leaving~Trial*Day*Dist,random=~1|Indiv,family="binomial") I get the error: iteration 1 Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1 >From looking at previous help