similar to: piecewise linear regression

Displaying 20 results from an estimated 1000 matches similar to: "piecewise linear regression"

2018 May 28
3
How to generate a conditional dummy in R?
Hi everyone, I am trying to generate a conditional dummy variable ?X" with the following rules set X=1 if Y is =1, two years prior to the NA. [0,0,NA]. For example, if the pattern for Y is 0,0,NA then the X variable is =0 for all the two years prior to the NA. If the pattern for Y is 0,1,NA or 1,0,NA then the X =1 . To be clear, if 1,1,NA then the X=1 that first specific year, it
2018 May 29
0
How to generate a conditional dummy in R?
Hi Faradj, What a problem! I think I have worked it out, but only because the result is the one you said you wanted. # the sample data frame is named fkdf Y2Xby3<-function(x) { nrows<-dim(x)[1] X<-rep(0,nrows) for(i in 1:(nrows-2)) { if(!is.na(x$Y[i])) { if(x$Y[i] == 1 && any(is.na(x$Y[(i+1):(i+2)]))) X[i]<-1 if(i > 1) { if(X[i-1] == 1) X[i]<-0 } }
2018 May 29
1
How to generate a conditional dummy in R?
Dear Jim, wow! It worked! Thanks a lot. I did as you suggested and it worked well with the real data. Although it gave me this error: Error in if (!is.na(x$Y[i])) { : argument is of length zero. For some reason the X1 produced less observations than it is in the data. But it's not a big deal - I identified those cases and simply deleted from the data (it was countries that only appeared
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help. #Reproducible script Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv") View(Empdata) str(Empdata) Empdata$gnipc<-as.numeric(Empdata$gnipc) install.packages("systemfit") library("systemfit") pdata <- plm.data(Empdata,
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end. I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis. I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel. #Reproducible script Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv") View(Empdata) install.packages("systemfit")
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal. On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of smarter folks than I on it who can help. I may or may not have time to look at this. Hopefully someone else will. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2015 May 14
3
comportamiento de data.table al hacer calculos por grupos
Estimada comunidad tengo un problema del que no encuentro datos que me ayuden mucho en la web. Estoy haciendo calculos por grupos con data,table. Tengo un archivo (zp.res) con tres columnas que clasifican los datos (sol, con, dia) y una columna de datos numericos (media), de la siguiente forma: sol con dia media 1: con 0 1 -22.6 2: con 0 1 -36.6 3: con 0 1 -35.6 y
2006 Oct 15
1
gamma distribution don't allow negative value in GLMs?
Dear friends, when i use glm() to fit my data, i use glm(formula = snail ~ vegtype + mhveg + humidity + elevation + soiltem, *family = Gamma(link = inverse),* data =a,)) It shows: error in eval(expr, envir, enclos) : *gamma distribution don't allow negative value*. But i use result<-glm(formula = snail ~ vegtype + mhveg + humidity + elevation + soiltem, family = poisson, data =a) #this
2007 Feb 19
1
need help in reading TOMS observed ASCII data file
Hello R Users, I am new to R. I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS ozone(O3). > > AOD data is on 1x1 grid and O3 data is on 5x5 grid. > > First I want to read AOD and O3 as it is and then I want to regrid AOD on > 5x5 grid as O3. > > Reading is first problem. > > FIRST PROBLEM READING AOD: > > AOD data is in following format: >
2010 Apr 16
2
managing data and removing lines
Hi, I am very new to R and I've been trying to work through the R book to gain a better idea of the code (which is also completely new to me). Initially I imputed my data from a text file and that seemed to work ok, but I'm trying to examine linear relationships between gdist and gair, gdist and gsub, m6dist and m6air, etc. This didn't work and I think it might have something to do
2007 Feb 19
0
problem in reading TOMS observed ASCII data file
Hello R Users, I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS ozone(O3). AOD data is on 1x1 grid and O3 data is on 5x5 grid. First I want to read AOD and O3 as it is and then I want to regrid AOD on 5x5 grid as O3. Reading is first problem. FIRST PROBLEM READING AOD: AOD data is in following format: ######### Latitute: 89.5 167 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 200
2007 Aug 20
1
Ask for functions to obtain partial R-square (squared partial correlation coefficients)
The partial R-square (or coefficient of partial determination, or squared partial correlation coefficients) measures the marginal contribution of one explanatory variable when all others are already included in multiple linear regression model. The following link has very clear explanations on partial and semi-partial correlation: http://www.psy.jhu.edu/~ashelton/courses/stats315/week2.pdf In
2012 Sep 10
0
More help need on Von Bertalanffy Growth Curves
Howdy, Last week I got some great help on why I was getting an error code when trying to run this model, thanks everyone!  I was able to get the code up and running beautifully for several data sets.  Now I am getting different errors with this new data set.  I can't figure out why, I have more data points with this species, and it is ordered exactly the same as the other species I have been
2012 Sep 02
3
Loading Chess Data
All, What would be the most efficient way to load the data at the following address into a dataframe? http://ratings.fide.com/top.phtml?list=men Thanks, David -- View this message in context: http://r.789695.n4.nabble.com/Loading-Chess-Data-tp4642006.html Sent from the R help mailing list archive at Nabble.com.
2003 Dec 05
1
Can anyone help me reproduce this SAS Mixed output??
I asked this before and I am going to try again in more applied terms. I am trying to use R to extract variance components for a two-factor random effects model with both factors crossed. It would also be nice to generate some confidence intervals as well. For example, a data set using SAS Proc Mixed is below followed by the four variance component estimates and the respective confidence
2008 Dec 21
2
data format issue
Dear all- I have a dataset (see a sample below - but the whole dataset is June 2005 - June 2008). The "LST" format is "YYMMDDHHmm" and I would like to get the hourly average of the "mph" for the summer months (spanning all years). I have been trying to use "aggregate" but am not having much success at all! any thoughts would be greatly appreciated.
2011 Jan 17
1
filling in datasets of differing lengths
g''day all, I need help with this please. I have a dataset of site names and years they were trapped in (a subset of it is bs, below) and a dataset of sites that actually caught animals (subsetted as brep, below). I need to add to brep, a row with a zero in the classcount column, for every year each site was trapped but caught nothing. so for Site 1, I need to add rows that say
2008 Aug 01
0
multinomRob: Error in eigen [..] infinite or missing values in 'x'
I'm interested in analysing some of my data using multinomial regression. I have been using nnet's multinom so far. However, I found that some of the data shows overdispersion and hence want to change to robust multinomial regression, package: multinomRob I have succesfully implemented Agresti's (2002) alligator example (chapter 7, p 268) using the option MLEonly=TRUE as there are too