search for: state2

Displaying 20 results from an estimated 27 matches for "state2".

Did you mean: state
2018 Feb 09
1
Optim function returning always initial value for parameter to be optimized
Hello, I'm trying to fminimize the following problem: You have a data frame with 2 columns. data.input= data.frame(state1 = (1:500), state2 = (201:700) ) with data that partially overlap in terms of values. I want to minimize the assessment error of each state by using this function: err.th.scalar <- function(threshold, data){ state1 <- data$state1 state2 <- data$state2 op1l <- length(state1) op2l <- le...
2011 Nov 15
1
Remove thw data from the dataframe
Hi, I want to remove the entire row from the dataset if any of the row contains blank or NA my dataset look like State Year Y X2 X3 X4 X5 X6 State1 1960 27.8 397.5 42.2 50.7 78.3 65.8 State2 1960 29.9 413.3 38.1 52 79.2 66.9 State1 1961 29.8 439.2 40.3 54 79.2 67.8 State2 1961 30.8 459.7 39.5 79.2 69.6 State1 1962 31.2 492.9 37.3 54.7 77.4 68.7 State2 1962 528.6 38.1 80.2 73.6 State1 1963 35.6 560.3 39.3 69.8 80.4 76.3 State2 1963 36.4 624.6 37.8 65.9 77.2 State1 1964 666.4 38.4 6...
2012 Mar 27
1
help in replacing for llop
Hi I have records like like this X1 X2 State 34 72 state1 9 63 state1 49 31 state1 60 34 state1 80 73 state1 60 20 state2 59 87 state2 88 20 state2 71 66 state2 65 56 state2 59 16 state1 60 100 state2 I want to get the summarize value like mean median histogram for X1 and X2 based on state. I'm using FOR loop for this. Is there any method to remove for loop and use apply or any alternatives ----- Thanks in Ad...
2011 Dec 06
1
making changes to global variables in functions
I'm trying to write a function that takes several objects with many different attributes and then changes their attributes. So what I wanted to happen in the simplified example below is for the function to change the attributes of the objects state1 and state2 that are passed to it. But because stateA and stateB are local, this isn't working. Are there any easy solutions? e.g., if I could combine the two objects stateA and stateB into a single object, I could return it and then assign it back to objects state1 and state2. Or if I could pass a pointe...
2018 Feb 10
0
Optim function returning always initial value for parameter to be optimized
On 02/10/2018 06:00 AM, r-help-request at r-project.org wrote: > Did you check the gradient? I don't think so. It's zero, so of course > you end up where you start. > > Try > > data.input= data.frame(state1 = (1:500), state2 = (201:700) ) > err.th.scalar <- function(threshold, data){ > > state1 <- data$state1 > state2 <- data$state2 > > op1l <- length(state1) > op2l <- length(state2) > > op1.err <- sum(state1 <= threshold)/op1l > op2.er...
2009 Aug 01
2
Add columns in a dataframe and fill them from another table according to a criteria
...I have table called States.Prob which is given below:- This table gives the probabilities of the changes in the swap curve depending on the state of the swap curve. I want to put these probabilities in my dataframe mydata(given after the prob table). Prob of States Changes State1 State2 State3 State4 a Pa1 Pa2 Pa3 Pa4 b Pb1 Pb2 Pb3 Pb4 c Pc1 Pc2 Pc3 Pc4 d Pd1 Pd2 Pd3 Pd4 and I have a dataframe(with 93 rows) called mydata part of which(6 rows) is given below where I want to fill in...
2012 Jan 13
1
Change state names to abbreviations in an irregular list of names, abbreviations, null values, and foreign provinces
...states & counties using data from Herp.net, which provides lists of specimens with the places that they were found. First I would like to parse the list by state using 2-letter abbreviations, since I'm focusing on certain regions. To do this, I've been trying to create a vector (state2) that gives all state names as 2-letter abbreviations, using advice given on the thread: http://tolstoy.newcastle.edu.au/R/help/05/09/12136.html However, the code provided there does not work when the original list includes null values and foreign provinces, like "Cusco." I've use...
2009 Dec 06
2
Error in eval(expr, envir, enclos) : object 'N' not found
...<- function(t, state, pars) { with (as.list(c(state, pars)), { dT=(a*T-a*T*b*T) - (c1*N*T) - (Kt*M*T) dN=a1 - (f*N) + g * (T/(h+T)) * N - (p * N * T) - (Kn * M * N) dC=a2 - (beta * C) - (Kc * M * C) dM= -(gamma) * M + Vm return(list(c(dT,dN,dC,dM))) }) } model2 <- function(t, state2, pars2) { with (as.list(c(state2, pars2)), { dT=(a*T-a*T*b*T) - (c1*N*T) - (Kt*M*T) dN=a1 - (f*N) + g * (T/(h+T)) * N - (p * N * T) - (Kn * M * N) dC=a2 - (beta * C) - (Kc * M * C) dM= -(gamma) * M + Vm return(list(c(dT,dN,dC,dM))) }) } ### First Half - Tumor growth to 10% pars &lt...
2005 Aug 12
1
Encode/Decode problem
...Any help would be greatly appriciated. Thanks! Jamie Stanton jstanton@clairvista.com I've got the following code: static void testAudio(UInt8 *data, long dataLength) { //data is a linear PCM stream from an attached microphone. sample rate is 8000, 16 bits per sample void *state; void *state2; SpeexBits bits; short tempShort; short tempPtr[160]; short tempPtrDecode[160]; state = speex_encoder_init(&speex_nb_mode); state2 = speex_decoder_init(&speex_nb_mode); speex_bits_init(&bits); //code simplified to just read in the first frame for (int i = 0; i < 320; i +=2) { tem...
2005 May 24
1
rsync incorrectly deletes files ?
rsync -e 'ssh -x' --log-format="%o /%n %b" -tLr --delete --files-from=files-to-sync --exclude-from=files-to-exclude user@host:/ /temp/ del. /etc/mail/spamfilter/mx1/whitelist.conf 0 del. /etc/mail/spamfilter/mx1/blacklist.conf 0 recv /etc/mail/spamfilter/mx1/ 0 recv /etc/mail/spamfilter/mx1/blacklist.conf 211 recv /etc/mail/spamfilter/mx1/whitelist.conf 924 Why does rsync
2011 Jul 27
1
To Merge or to use Indicator Variables?
Greetings all, I have two sets of data that I would like to investigate. The first is gene/genome related data given different 'cell-states'. The second set of data is relates the genes to a biological pathway. /(I think in pictures so here goes.)/ *dataframe1* gene, cell-state1, cell-state2 gene1, x1, y1 gene2, x2, y2 gene.x, ..., ... *dataframe2* pathway1, gene-x1, gene-x2, ... pathway2, gene-y1, gene-y2, ... What I want to do is, see if 'cell-state1' (in-)activates different genes / pathways from 'cell-state2.' Furthermore, I would like to test for correlation /(t-...
2009 Jul 31
1
Fill dataframe from a table according to a criteria
Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below Prob of States Changes State1 State2 State3 State4 A Pa1 Pa2 Pa3 Pa4 B Pb1 Pb2 Pb3 Pb4 C Pc1 Pc2 Pc3 Pc4 D Pd1 Pd2 Pd3 Pd4 and I have a dataframe called mydata which is given below where I want to fill in the last four columns of proba...
2009 Aug 04
2
Caculate first difference from a dataframe; write a simulation
...e.lowest=T) summary(z.level) q<-quantile(mydat3[[2]],c(0,0.25,0.75,1)) z.shape<-cut(mydat3[[2]],q,include.lowest=T) summary(z.shape) #to identify States in mydat3 attach(mydat3) state1<-data.frame(mydat3[spread>=-Inf & spread<= -0.02 & Level>=-Inf & Level<=3.24,]) state2<-data.frame(mydat3[spread>-0.02 & spread<= 1.91 & Level>=-Inf & Level<=3.24,]) state3<-data.frame(mydat3[spread>1.91 & spread<= Inf & Level>=-Inf & Level<=3.24,]) state4<-data.frame(mydat3[spread>=-Inf & spread<= -0.02 & Level&g...
2004 Apr 29
3
Dummies in R
...city==12&year==2000 and (2) Create a Time-Dummy-Variable g byte T2000=0 replace T2000=1 if year==2000 (3) I need the City DUmmy for the following combination: I have the financial flows between two cities in the state and I need the paired-Dummy for the exporter (state1) and importer (state2): g byte city11=0 replace city11=1 if state1==12¦state2==12 (4) I am interesting in residuals for particular city==12. I have the Dummy for City==12 and regress it on Y-Variable. How could I extract from the output in R the residulas for city==12 (1) to plot this residuals and residuals from ot...
2001 Mar 16
1
combine dataset
Hi, I have two data sets look like below: ========================== state count1 percent1 CA 19 0.34 TX 22 0.35 FL 11 0.24 OR 34 0.42 GA 52 0.62 MN 12 0.17 NC 19 0.34 state count2 percent2 FL 22 0.35 MN 22 0.35 CA 11 0.24 TX 52 0.62 ========================== How to combine these two data set and make it look like below?
2009 Dec 01
1
LMER: How to specify Random Effects
I saw different specifications for Random Effects and I'm confused about the use of "/" and the use of "(0+...|)" . Let say we have a nested structure where some countries have some several plants in different states and we measure the reaction to a drug. The list of Countries = USA, France, Italy The States for USA = Michigan, Florida, California The States for France
2012 Jun 28
1
undefined S4 class in parallel computing at snowfall
...uot;, representation(bb = 'character', cc = "catt")) f1 <- function(y1) { new('catt', aa = y1 + 1) } f3 <- function(y2, y3) { new('dogg', bb=c(y2, 'GA'), cc = f1(y3)) } dat <- 1:5 f1(dat) f3('NY', dat) sapply(c("state1", 'state2', 'state3'), f3, dat) sfExportAll() sfClusterEval(ls()) sfSapply(c("s1", 's2', 's3'), f3, dat) sfStop() # sfSapply generates the following error # Error in checkForRemoteErrors(val) : # 2 nodes produced errors; first error: "dogg" is not...
2009 Jul 28
1
Sort a column in a dataframe
...4 3.6457 3.6913 3.7725 3.8669 3.9410 5 5.3050 5.3575 5.4450 5.5425 5.6300 6 4.1230 4.1650 4.2360 4.3170 4.3960 DMSW30Curncy.x EUSA40Curncy.x EUSA50Curncy.x spread.x level.x State1 State2 1 4.8925 4.8400 4.7975 2.0005 4.006772 NA NA 2 4.2890 4.2460 4.2040 0.1640 4.165147 NA NA 3 5.3412 5.2913 5.2638 1.2602 4.792737 NA NA 4 3.9840 3.9760 3.9560 0.8168 3.550524 NA NA...
2012 Sep 11
1
Plotting every probability curve
...t I can save them library(TeachingDemos) TkPredict(mod1) Predict.Plot(mod1, pred.var = "our_bid", our_bid = c(0,300), age_of_oldest_driver2 = "18 to 21", credit_type2 = "POOR", coverage_type2 = "BASIC", home_owner2 = "0", state2 = "other", currently_insured2 = "0", vehicle_driver_score = "0", plot.args = "list()", type = "response") Quick reproduceable example = df = data.frame(sell=c("0","1","0","0","1"), hom...
2009 Aug 05
1
writing a simulation
...ending on the sample result) is given below Level spread X1 4.77 0.68 #I want to identify which state ad lies in according to the breaks identified in table(z.shape,z.level) attach(ad) state1<-data.frame(ad[spread>=-Inf & spread<= -0.02 & Level>=2.8 & Level<=3.24,]) state2<-data.frame(ad[spread>-0.02 & spread<= 1.91 & Level>=2.8 & Level<=3.24,]) state3<-data.frame(ad[spread>1.91 & spread<= 2.5 & Level>=2.8 & Level<=3.24,]) state4<-data.frame(ad[spread>=-Inf & spread<= -0.02 & Level>=3.24 &...