Posts by Henrique Pizarro • 659 points
19 posts
-
5
votes2
answers1839
viewsQ: Column chart stacked in R
I have a database where variables assume integer values from 1 to 5. Follow an example base with variables X1, X2 and X3: base<- rbind( c(5,3,3),c(4,3,2),c(4,5,4),c(1,5,1),c(1,2,1),c(3,4,2),…
rasked Henrique Pizarro 659 -
3
votes2
answers2443
viewsQ: How to get data from the previous line in SQL?
How to create a column with the value of the previous row of another column? Follow example, I have the column time and I want to create the column time_lag: Tabela inicial: id | title | time |…
sqlasked Henrique Pizarro 659 -
4
votes1
answer368
viewsQ: How to remove duplicated rows by holding other columns
In the example below, I am interested in removing duplicates of rows in columns title and time no matter how many columns. In the example below I am interested that the query returns rows 32, 34 and…
-
2
votes1
answer1232
viewsQ: Date input in SAS
Please try to enter dates in various ways by input from SAS Enterprise Guide version 7.1, but anyway the result always comes out in numerical form, follow an example of the code: data work.family;…
-
4
votes1
answer760
viewsQ: How to sort boxplots by average or median on R
How to order a series of boxplots by median or average? The command used: boxplot(base$y~base$FID) sorts charts by order of the base variable$FID, I would need the sort to be done by the average or…
rasked Henrique Pizarro 659 -
2
votes1
answer309
viewsQ: Function Predict() does not accept exponential regression in R
Please try to perform a parametric modeling of survival analysis and function predict() is returning an error that does not recognize a variable, but it is there. Following example: base=NULL…
-
3
votes1
answer164
viewsQ: ARIMA model with 1 and 25 lag in R
Please, when applying the ARIMA(p,d,q) modeling in a series, in the partial autocorrelation function a peak appears in lag 1 and another in 25 and no other statistically significant. There is some…
rasked Henrique Pizarro 659 -
2
votes1
answer119
viewsQ: Error with factor analysis command
The command factanal() factor analysis shows a meaningless error message. I have to perform the factor analysis, I want to compare the scores obtained when using the solutions by the variance matrix…
rasked Henrique Pizarro 659 -
3
votes2
answers647
viewsQ: SAS and R run Merge differently
What is the difference between how R and SAS perform merge? The SAS Merge command returns 205546 lines whereas the R command returns 207208 lines. Following example. I am working with the IBGE file…
-
4
votes2
answers93
viewsQ: Does R have a similar command to SAS IN?
R has some command similar to SAS IN? Follow an example in SAS code: variable1 IN (4,5,6,7) THEN variable2 = 1; That is, if the variable1 assumes the values from 4 to 7, the variable2 is assigned…
-
1
votes1
answer189
viewsA: Problem with missings in variable weight in complex sampling
Apparently the variable assigned to the Weight parameter cannot contain missings. In my particular case the base contained only 12 cases of 62000, so I assigned zero to the missings and the command…
ranswered Henrique Pizarro 659 -
5
votes1
answer189
viewsQ: Problem with missings in variable weight in complex sampling
The presence of missings in the variable weight of a complex sampling is preventing the R from calculating the mean. Initially I tried the na.rm = TRUE, but it did not work, follows excerpt:…
rasked Henrique Pizarro 659 -
2
votes1
answer330
viewsQ: Even using "na.rm = TRUE" the error message of Missing values appears
When I use the complex sample average command, a warning appears that there are Missing values in Weights, but I am using the option na.rm = TRUE. Does anyone know what happens? Follow the passage:…
rasked Henrique Pizarro 659 -
1
votes0
answers461
viewsQ: How to use SAS Enterprise Guide to work with complex samples?
I need to model PNAD data - IBGE, which uses a complex sampling plan. It is possible to use SAS Enterprise Guide in this modeling?
sasasked Henrique Pizarro 659 -
3
votes2
answers513
viewsQ: Survey and count package
I am working with the IBGE database - PNAD with the help of the Survey package. To count responses (for example, the proportion of people under 15 years of age in the northern region) is it…
rasked Henrique Pizarro 659 -
2
votes2
answers296
viewsQ: What does the "Design has only one Primary sampling Unit" error mean?
I am using the R Survey package and, while performing some svymean(), what returns is the Warning: Design has only one Primary sampling Unit.…
rasked Henrique Pizarro 659 -
2
votes1
answer125
viewsQ: Mean Difference Hypothesis Test in R Survey Package
Please, using the Survey package, how to make a hypothesis test of mean difference? i.e. if the sample mean of 2003 is the same in 2008 for a certain variable. I’m working with PNAD data
rasked Henrique Pizarro 659 -
3
votes1
answer98
viewsQ: How to create Abels in a binary vector without it becoming categorical?
I have a binary variable in a dataframe, want to assign the label "no" for the value 0 and "yes" for the value 1 without the vector becoming categorical (if this occurs, I cannot use the function…
rasked Henrique Pizarro 659 -
2
votes2
answers139
viewsQ: How to use the svymean() function if I have missings in the observations?
I’m using the function svymean() package Survey but when the data have missings ("Als"), the mean is not calculated. Please, someone knows how to fix this?…
rasked Henrique Pizarro 659