similar to: I need to create new variables based on two numeric variables and one dichotomize conditional category variables.

Displaying 20 results from an estimated 1000 matches similar to: "I need to create new variables based on two numeric variables and one dichotomize conditional category variables."

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,
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
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Well, something like: LAP <- ifelse(gender =='male', (WC-65)*TG, (WC-58)*TG) The exact code depends on whether your variables are in a data frame or list or whatever, which you failed to specify. If so, ?with may be useful. Cheers, Bert On Fri, Nov 3, 2023 at 3:43?AM Md. Kamruzzaman <mkzaman.m at gmail.com> wrote: > Hello Everyone, > I have three variables: Waist
2023 Nov 03
1
I need to create new variables based on two numeric variables and one dichotomize conditional category variables.
Hello Everyone, I have three variables: Waist circumference (WC), serum triglyceride (TG) level and gender. Waist circumference and serum triglyceride is numeric and gender (male and female) is categorical. From these three variables, I want to calculate the "Lipid Accumulation Product (LAP) Index". The equation to calculate LAP is different for male and females. I am giving both
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 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
2024 Jan 17
1
Is there any design based two proportions z test?
Dear Md Kamruzzaman, To answer your second question first, you could just use the svychisq() function. The difference-of-proportion test is equivalent to a chisquare test for the 2-by-2 table. You don't say how you computed the confidence intervals for the two separate proportions, but if you have their standard errors (and if not, you should be able to infer them from the confidence
2024 Jan 17
1
Is there any design based two proportions z test?
Hello Everyone, I was analysing big survey data using survey packages on RStudio. Survey package allows survey data analysis with the design effect.The survey package included functions for all other statistical analysis except two-proportion z tests. I was trying to calculate the difference in prevalence of Diabetes and Prediabetes between the year 2011 and 2017 (with 95%CI). I was able to
2024 Jan 18
0
Is there any design based two proportions z test?
Dear Md Kamruzzaman, I've copied this response to the r-help list, where you originally asked your question. That way, other people can follow the conversation, if they're interested and there will be a record of the solution. Please keep r-help in the loop See below: On 2024-01-17 9:47 p.m., Md. Kamruzzaman wrote: > > Caution: External email. > > > Dear John >
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,
2008 May 05
2
Character entry mismatch in the console window
Dear R users, I have just de-installed my old R 2.4.1 and installed R 2.7.0. I downloaded this version from the South African mirror, as I am currently working in South Africa. When trying to paste any of my old analyses into the console (I keep them in word-documents), I get an error when I first try to load the data with the following line (example): lap.long.dist <-
2002 Sep 17
1
smbclient return status from shellscript?
Hi, I hope this is the correct mailinglist for my question. I've made a script that sends a file to a NT shared folder. As long as I make a successfull connect, I get return status 0... This is a problem, since now I can't make a correct errorhandling if something goes wrong. +/opt/samba-2.0.5a/bin/smbclient //mapa-lap/mapaPublic -E -d0 -I XXX.YYY.ZZZ.WWW -n mapa-lap -N -U guest -c put
2010 Apr 21
2
Maximum Likelihood Estimation in R
Dear R-Help, I also send the following post by e-mail to you, however I try to post it here aswell. My name is Henrik and I am currently trying to solve a Maximum Likelihood optimization problem in R. Below you can find the output from R, when I use the "BFGS" method: The problem is that the parameters that I get are very unreasonable, I would expect the absolute value of each
2012 Feb 03
0
[LLVMdev] Issues with the llvm.stackrestore intrinsic - now LoopRotation handling of alloca
Hi, I've tracked the first problem (mentioned in my previous email, quoted below) down further, ending up in the handling of alloca in LoopRotation.cpp (from trunk): // If the instruction's operands are invariant and it doesn't read or write // memory, then it is safe to hoist. Doing this doesn't change the order of // execution in the preheader, but does
2018 Jul 26
2
Is decoupling Apache + PHP into separate nodes possible?
<preamble> I have deployed Linux/Apache/PHP (node1) + MySQL (node2) with Security Groups (AWS) or iptables controlling who can connect to the MySQL server. In topology terms -- a 2 Tier architecture. In AWS - one can deploy several such instances behind a ELB. Each LAP instance talks to a MySQL RDS. The LAP instances are either mod_php or PHP-FPM. OS -- CentOS, Ubuntu. Debian
2012 Feb 03
1
[LLVMdev] Issues with the llvm.stackrestore intrinsic - now LoopRotation handling of alloca
2012/2/3 Patrik Hägglund <patrik.h.hagglund at ericsson.com>: > Hi, > > I've tracked the first problem (mentioned in my previous email, quoted > below) down further, ending up in the handling of alloca in > LoopRotation.cpp (from trunk): > >      // If the instruction's operands are invariant and it doesn't read > or write >      // memory, then it is
2011 Jul 09
3
Wierd cursor jump when I type letter "y"
Guys. I have this problem for a long time. In large number of times when I type letter "y", like in "you" my typing cursor jumps 2-3 rows up or 1-2 words to the left. I am unable to understand why. Could it be something with lap-top keyboard? Typing rate? CentOS 5.5 Gnome, I mostly use Firefox and Thunderbird. Ljubomir
2008 Aug 19
1
R vs Stata on generalized linear mixed models: glmer and xtmelogit
Hello, I have compared the potentials of R and Stata about GLMM, analysing the dataset 'ohio' in the package 'faraway' (the same dataset is analysed with GEE in the book 'Extending the linear model with R' by Julian Faraway). Basically, I've tried the 2 commands 'glmmPQL' and 'glmer' of R and the command 'xtmelogit' of Stata. If I'm not
2004 Aug 05
1
ANOVA with repeated measurements (Dan Rajdl)
Dear R-users, I have some human serum lipid concentrations (cholesterol, apoB ...), each lipid was measured (in the same person) for 6 times in different time points (start, 3 months, 6 months, 12 months, 18 months, 24 months). There were 2 groups of participants: one with a nutritional intervention and the other without it. I would like to know, whether lipid concentrations differ among different
2007 Feb 01
12
FOSDEM?
Hi all, A couple of people are trying to convince me to come to FOSDEM in Belgium at the end of February. I''m a bit hesitant because I''ve been doing so much travel, but LinuxConf.au was a great experience and seems to have really helped get exposure to Puppet. There seems to be a pretty strong European contingent of Puppet users, and it''d be great to meet