# r scripting

1. ### segemented analysis in R??

segmented analysis in R?? Dear Experts, I have got a bunch of scripts which performs segmented or piecewise regression analysis in R. for some reason, I am not getting desirable output, I don't know why. the code is: test <- read.delim("C:/Users/Dsuresh/Desktop/h77.txt") attach(test)...
2. ### Help Needed: Multivariate Regression Using R

I am testing the a couple of CAPM based models for my dissertation, and I have a healthy amount of stocks to regress, 5000 according to my last calculations, they’d have to be done as 75 stocks at a time, (in a portfolio). The number makes it an unrealistic task to accomplish manually, I have...
3. ### Finding the best way to prepare raster image for a function

Hello all, I'd like to ask what is the best way to prepare big raster images in R to run a function on whole images. I have 30 tiff images with the size of ncol=12648, nrow=4144. I read them in R separately. Then, I stacked all 30 raster images into one. Now the image size is ncol=12648...
4. ### How to crop an image into small sections automatically in R

Hello all, I'd like to crop an image into 15 sections in R. The image projection is Geog lat/long, extending 87 to 120 degree in East and 45 to 55 degree in North. I want to separate it by every 2 degree. So I have 17 degree in X coordinate and 5 degree in Y coordinate. 17 x 5= 85 sections...
5. ### How to read multiple images automatically in R?

Hello all, I have 30 tiff images in the same folder. The name of files are btv_2000097, btv_2000105 ....until btv_2000297. I can read them one by one in R, and then stack all individual layers into a raster object with 30 layers. I have 15 year images. Totally more than 300 images...
6. ### Error with "lowess" function in R

I have a problem with lowess function to smooth time series NDVI (8-day image from apr to oct in Julian day) as a function of time by polynomial regression in R. Here is the scripts I run: #Create a time vector to act as x time<-sort(sample(97:297, nlayers(ndvi2000crop1)))...
7. ### Using instrumental variables to measure trade policy effects

I'm an undergrad econ student trying to use R for the first time and I'm quite confused as to which script I should use and how to use it. I'm studying the effects of AGOA(African Growth and Opportunity Act) on textile exports of a nation and as such I've been trying to use three types of...