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 800 matches similar to: "I need to create new variables based on two numeric variables and one dichotomize conditional category variables."

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.
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>
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,
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
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
2007 Jun 18
1
how to obtain the OR and 95%CI with 1 SD change of a continue variable
Dear all, How to obtain the odds ratio (OR) and 95% confidence interval (CI) with 1 standard deviation (SD) change of a continuous variable in logistic regression? for example, to investigate the risk of obesity for stroke. I choose the happening of stroke (positive) as the dependent variable, and waist circumference as an independent variable. Then I wanna to obtain the OR and 95% CI with
2011 Jan 26
2
2 functions with same name - what to do to get the one I want
There seems to be 2 functions call ecdf... http://lib.stat.cmu.edu/S/Harrell/help/Hmisc/html/ecdf.html http://127.0.0.1:11885/library/stats/html/ecdf.html How do I get the one ecdf {Hmisc} to run instead of the ecdf {stats} A pointer in the right direction would be greatly appreciated. Tried to instal Hmisc but got this message, so I assume I have it > utils:::menuInstallPkgs() Warning:
2002 Dec 06
2
Mutiple page trellis plots with relation = "free" or "sliced"
Hello, Has anyone out there encountered a problem like this: xyplot(Plasma ~ Serum | Analyte, data = sp.df, aspect = 1, layout = c(1, 1, 200), scales = list(relation = "free") ) Gives the error: Error in pretty(x[is.finite(x)], ...) : x must be numeric On the other hand, this works (but I don't want the default of having everything on the same
2006 Dec 03
4
prop.trend.test issue
I have the clinical study data. Year 0 Year 3 Retinol (nmol/L) N Mean +-sd Mean +-sd Vitamin A group 73 1.89+-0.36 2.06+-0.53 Trace group 57 1.83+-0.31 1.78+-0.30 where N is the number of male for the clinical study. I want to test if the mean serum retinol has increased over 3 years among subjects in the vitamin A group. > 1.89+0.36
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 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
2007 Dec 13
2
Function for AUC?
Hello Is there an easy way, i.e. a function in a package, to calculate the area under the curve (AUC) for drug serum levels? Thanks for any advice -- Armin Goralczyk, M.D. -- Universit?tsmedizin G?ttingen Abteilung Allgemein- und Viszeralchirurgie Rudolf-Koch-Str. 40 39099 G?ttingen -- Dept. of General Surgery University of G?ttingen G?ttingen, Germany -- http://www.chirurgie-goettingen.de
2018 May 22
2
Nelson-Aalen Estimator in R: Error Message
Dear all, Currently, I am doing a research project about serum sodium levels and falling. I am doing my analysis in R. I am performing the multiple imputation right now. I want to perform a survival analysis later, but therefore I need to specify the Nelson-Aalen estimator. My dataset is called DF1, the event indicator is Falls and the time variable is Time. The code that I use is as follows:
2006 Apr 10
2
TukeyHSDs function (pgirmess package)
Dear R-help, I have been trying to use the TukeyHSDs function in the "pgirmess" package to quickly extract all significant pairwise comparisons in an aov object. However, it seems that this function isn't working as intended when only the two last populations means being tested are significant. An example of this can be seen below: >numbers<-c(464,482,453,434,495,487)
2005 Oct 16
1
measurement error model - "simple" linear regression
Dear friends, I found the thread on this subject this summer but wonder whether it has been taken any further. I have an important medical problem where X is computed from a three independent and complicated measurements (exchangeable sodium and potassium and total body water - i.e. X = (Nae+Ke)/TBW ) and Y is serum sodium concentration (all data in Edelman, JCI 1958). I have the individual
2008 Dec 09
1
creating standard curves for ELISA analysis
Hello R guru's I am a newbie to R, In my research work I usually generate a lot of ELISA data in form of absorbance values. I ususally use Excel to calculate the concentrations of unknown, but it is too tedious and manual especially when I have 100's of files to process. I would appreciate some help in creating a R script to do this with minimal manual input. s A1-G1 and A2-G2 are
2018 May 22
0
Nelson-Aalen Estimator in R: Error Message
Hard to tell from the info you are giving us. I assume this regards the "mice" package? One way to proceed is to set options(error=recover) which will dump you into the browser() environment when the error occurs and you can oka around and see what the value of variables was at the point of the error. This could give you a clue about what is going on. -pd > On 22 May 2018, at 15:29
2011 Mar 05
2
Grouping data in ranges in table
Working with the built in R data set Orange, e.g. with(Orange, table(age, circumference)). How should I go about about grouping the ages and circumferences in the following ranges and having them display as such in a table? age range: 118 - 664 1004 - 1372 1582 circumference range: 30-58 62- 115 120-142 145-177 179-214 Thanks for any feedback and insights, as I hoping for an output that