Statistical Packages

110

Solutions

269

Contributors

Statistical packages are software titles, such as JMP and GNU Octave, and programming languages, such as MATLAB, R and SAS, that are used to discover, explore and analyze data and suggest useful conclusions, either to learn something unexpected or to confirm a hypothesis. The field includes the design and analysis of techniques to give approximate but accurate solutions to hard problems in statistics, econometrics, time-series, optimization and 2D- and 3D-visualization. Data analysis has multiple facets and approaches, encompassing diverse techniques under a variety of names, in different business, science, and social science domains.

Share tech news, updates, or what's on your mind.

Sign up to Post

I would like to change the node names of my data.tree object (tjpCPI) from IDs to readable tags. A sample of the tree structure is here:
> print(tjpCPI, "CPI.Tag")
                                levelName                          CPI.Tag
1   378257447                                                          CPI
2    ¦--378257497                                                     Food
3    ¦   ¦--378259447                                              Cereals
4    ¦   ¦   ¦--378259457                                             Rice
5    ¦   ¦   ¦   ¦--378259467                                Non Glutinous
6    ¦   ¦   ¦   ¦   ¦--378259477                                   Rice-A
7    ¦   ¦   ¦   ¦   °--378259487                                   Rice-B
8    ¦   ¦   ¦   °--378259497                                    Glutinous
9    ¦   ¦   ¦--378259507                                            Bread
10   ¦   ¦   ¦   ¦--378259517                                  White Bread
11   ¦   ¦   ¦   ¦--378259527                                Bean Jam Buns
12   ¦   ¦   ¦   °--378259537                                   Curry Buns
13   ¦   ¦   ¦--378259547                                          Noodles

I would like levelName to become CPI.Tag.

How might I do that without needing to iterate through each node?
0
Get your problem seen by more experts
LVL 12
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

I would like to change the names of the members of the list. The list is of a CPI hierarchy - the trouble is the names are now ID numbers, that are difficult to interpret. Each one of the members has a readable tag, that is "CPI.Tag".

How would I swap the label that is used for the name  currently to the "CPI.Tag"? (the display of a few sample members is attached)
2018-08-14_13-32-00.png

I thought it would be something along the lines of names(jpCPIlist)<-jpCPIlist$CPI.Tag, but evidently not..
0
How to remove any character from a string if it is not part of the below "x character set" .
Remove a character from a given string -if it is not part of the below x character set.
X character set: After removing the character there should not be any space on the character that gets removed.
---------------------
a b c d e f g h I j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9
/ - ? : ( ) . , ‘ +

Example
     '020?Dome@&++;stic CT out;%going?20测试叙事测试叙事@@@@test'
Expected output is
    020?Dome++stic CT outgoing?20test


I am using the below query but it is replacing '+'. I don't want to replace this + because it a part of x character set.

select translate(REGEXP_REPLACE ('020?Dome@&++;stic CT out;%going?20测试叙事测试叙事@@@@test','[^' || CHR(32) ||'-' ||CHR (127) || ']', ''),'+=!“%&*<>;{@#_',' ') AS TEST from dual;
0
Hi
I have one PDC server 2008R2 (D2R03Q02)  holding all FSMO roles and a second PDC server 2012R2 (PowerT130) who is not replicating any more since more than a month.

on PDC1 the command repadmin /showrepl shows no erros
on PDC2 the command repadmin /showrepl contains several errors

the netdom query FSMO shows all roles on PDC D2R03Q02

Connectivity: I can ping both servers

If I try to transfer FSMO to the second PDC PowerT130 I get the  ERROR The current Operations master is offline. The role cannot be transferred.
But the PDC D2R03Q02 is up and running and I can ping it from the second PDC.

Dcdiag show many errors and warnings on both PDC

Errors related to Ldap for example

or warnings like :

Warning: DcGetDcName(PDC_REQUIRED) call failed, error 1355

Warning: DcGetDcName(TIME_SERVER) call failed, error 1355
A Time Server could not be located.
The server holding the PDC role is down.
Warning: DcGetDcName(GOOD_TIME_SERVER_PREFERRED) call failed,
error 1355
A Good Time Server could not be located.

I attached The complet Dcdiag report dcdia.txt


DNSLINT command look good

DNSLint Report

System Date: Fri Jul 20 23:42:26 2018

Command run:

dnslint /ad 192.168.1.6 /s 192.168.1.7 /v

 Root of Active Directory Forest:

    Ecole.Schulz.Local
Active Directory Forest Replication GUIDs Found:
 
DC: D2R03Q02
GUID: 1a3677e0-7a77-413b-b70d-f0ede03ff7af

DC: POWERT130
GUID: …
0
The process of ML is comparable to data processing. Both systems search through information to appear for patterns. However, rather than extracting information for human comprehension as just in case of knowledge mining, ML uses that information to discover trends in data and alter program actions.
0
All, I am preparing for MFE (financial engineering). I could not thin of any other forum where i could seek help for clearing my doubts on financial products.

Dear experts, is my below understanding correct?

Is  r>-1  coming from this statement?

&&&1 + r&&&

if 1+r>0, then r>-1
*****

Extract from Stochastic Calculus for Finance 1

We introduce also an interest rate 1^n. One dollar invested in the money

market at time zero will yield 1 + r dollars at time one. Conversely, one dollar

borrowed from the money market at time zero will result in a debt of &&&1 + r&&&

at time one. In particular, the interest rate for borrowing is the same as the

interest rate for investing. It is almost always true that r >= 0, and this is

the case to keep in mind. However, the mathematics we develop requires only

that r > -1.

Kindly guide
0
I need to execute a substring function on each row of a single column dataframe in R Studio, then assign that value to a new dataframe.
0
hi,

Anyone know how to scale out R server/service in MS SQL 2016 and later?
0
Trying to run

        Dim RetVal As Long
        RetVal = Shell("for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO @if exist %%i: dir %%i:\*.* /s /b >E:\zzz\Zip-Bak\DayBkUp\DirectoryListHistory\%%i.txt")



Get error run time error 53 file not found?

It runs fine in a dos batch file

Trying to create a series of text files with a list of all files on each drive on my computer

Thanks
DIR-ALL-Drives.txt
0
Enabling R commands on T-SQL of MS SQL Server
I have installed Microsoft SQL server 2017 and SQL server management studio on my laptop computer with windows 10 Professional.  I am able to connect to the database from management studio.  I have also installed R (version 3.5.0 (The R foundation for Statistical Computing).
I learnt that from SQL server 2016 onwards, MS SQL server permits R commands on T-SQL.
I am familiar with both T-SQL and R commands.
I want to know how to enable execution of R commands on T-SQL.
0
Cloud Class® Course: Amazon Web Services - Basic
LVL 12
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Hello,
I'm trying to pass a value to a List, but I get an error Cannot implicitly convert System.Collections.Generic.List<char> to System.Collections.Generic.List<string>.
So, here's my code...
public List<string> NomeContrato { get; set; }

Open in new window


BindingSource bs = new BindingSource();
            bs.DataSource = LoadContratos();
            var editForm = new Concelhos_Edit();
            var editFormModel = new Info();
            editFormModel.Id = concelhos_datagrid.CurrentRow.Cells[0].Value.ToString();
            var _nomeContrato = contratosdt.AsEnumerable().FirstOrDefault(a => a.Field<int>("IdContrato") == ((DataRowView)bs.Current).Row.Field<int>("IdContrato")).Field<string>("Designacao");
            editFormModel.NomeContrato = _nomeContrato.ToList(); //--> Here's where the code breaks and get Error!

Open in new window


Changing this
public List<string> NomeContrato { get; set; }

Open in new window

to this
public List<char> NomeContrato { get; set; }

Open in new window

, I get my Combobox with one letter per line, like this...
W
o
r
l
d

Any help?
Thanks.
0
I would like to perform fractal analysis on a financial series (stock exchange index). What shall I use (prices or log returns) for calculating fractal dimension, Hurst Exponent, for performing R/S Analysis and for predictions? Are there R functions that calculate all of these immediately? Are there any things I need to take care of when analyzing the index? Thank you in advance!
0
First of all I am doing a program kinda simple long program, here is the full details:

The P-v-T relation for real gases can take many forms. The simplest relations are the ideal gas equation and the Van der Waals equation. These relations are to be applied to superheated steam. The file “pvt.txt” contains the P-v-T data of superheated steam (10 – 800 kPa) for the temperature range of 200 oC through 1200 oC, obtained from the steam tables.

Write a C program to read the steam table data “pvt.txt”. In the C program, estimate the density of steam for the pressure range 10 through 800 kPa, and temperature range 200 oC through 1200 oC,

(1) Using the ideal-gas relation: m3/kg where R = 0.4615 kJ/kgK, T is temperature [K] and P is pressure [kPa].

(2) Using the Van der Waals equation:

where R = 0.4615 kJ/kgK, T is temperature [K] and P is pressure [kPa]. The constants are obtained from and where Pcr = 22060 kPa and Tcr = 647.1 K.

In each case, calculate the resulting percentage error of the estimated density as follows: Error = x 100% Submit a report which must include: 1. Introduction, algorithm or flowchart, the C program, and the density from steam table. 2. The estimated density table when using the ideal gas equation. 3. The percentage error table when using the ideal gas equation. 4. The estimated density table when using the Van der Waals equation. 5. The percentage error table when using the Van der Waals equation. 6. Discussion and conclusion. Note: Density…
0
Please help i want the image to be in canny edge n perform fuzzy logic with this code

img1=imread('F:\Matlab Project\7 sem\currency\10.jpg')




Igray = 0.2989*img4(:,:,1)+0.5870*img4(:,:,2)+0.1140*img4(:,:,3);
%Igray1=edge(Igray,'Canny');
%figure
%image(Igray,'CDataMapping','scaled');
%colormap('gray')
%title('Input Image in Grayscale')

%Convert Image to Double-Precision Data
I = double(Igray);


%Scaling the factor
classType = class(Igray);
scalingFactor = double(intmax(classType));
I = I/scalingFactor;

%Obtain the Image Gradient

Gx = [-1 1];
Gy = Gx';
Ix = conv2(I,Gx,'same');
Iy = conv2(I,Gy,'same');

%figure
%image(Ix,'CDataMapping','scaled')
%colormap('gray')
%title('Ix')

%figure
%image(Iy,'CDataMapping','scaled')
%colormap('gray')
%title('Iy')

%Define the Fuzzy Inferences System
edgeFIS = newfis('edgeDetection');

%Specify the image gradients, Ix and Iy, as the inputs of edgeFIS
edgeFIS = addvar(edgeFIS,'input','Ix',[-1 1]);
edgeFIS = addvar(edgeFIS,'input','Iy',[-1 1]);

%
sx = 0.1;
sy = 0.1;
edgeFIS = addmf(edgeFIS,'input',1,'zero','gaussmf',[sx 0]);
edgeFIS = addmf(edgeFIS,'input',2,'zero','gaussmf',[sy 0]);
%
edgeFIS = addvar(edgeFIS,'output','Iout',[0 1]);

%Specify the triangular membership functions, white and black, for Iout.
wa = 0.1;
wb = 1;
wc = 1;
ba = 0;
bb = 0;
bc = 0.7;
edgeFIS = addmf(edgeFIS,'output',1,'white','trimf',[wa wb wc]);
edgeFIS = addmf(edgeFIS,'output',1,'black','trimf',[ba …
0
Hi,

Anyone know if the R server in SQL 2016 and R and Python feature in SQL 2017 need additional license?

Answer should be a no as MS always license everything SQL server by a single cost and ALL feature is charged already.
0
As the administrator for our MS Server 2016 Essentials network, I sometimes need to  view coworkers c drive.

I simply use WinKey R  > \\JanesCpu\c$   and supply my network admin credentials.  

For the rest of the day I can view  JanesCpu without supplying the credentials.

Clearly the admin credentials are being saved somewhere, but where are they, and how can I delete them when I am done?
0
Hi all,
I am not able to extract data from a package in r called rdota2. Wanted to run a function name get_league_listing from the package. Shows the following error-"Error in (function (..., deparse.level = 1, make.row.names = TRUE, stringsAsFactors = default.stringsAsFactors())  :
  numbers of columns of arguments do not match". please help me out. Thanks in advance.
0
I'm not able to send an image with a  text message on my iPhone 6. After selecting the recipient from contacts I select the camera icon to the left of the text field and select an image from my local images.  The image appears at the top of the screen.    Then I enter a text message and  and hit the green uparrow.  In a second I see a red message:  "Not Delivered."  This all repeatable.  The person I'm sending the message to has an Android.   Also, I 'm in range of a WiFi signal so I assume this is all going through WiFi and not Cellular.  Does anyone know what might be going on?

Thanks.
0
I am trying the code below so that if there is neither "/" nor "\" the output is an error and the application stops, but it does not work. I cannot see any thing wrong with the code.  Does any one sees any thing wrong?

 if (grepl("/", OUTpath, fixed=TRUE)) { # mac style
     OUTpath<- paste(paste(unlist(strsplit(OUTpath, "/", fixed=TRUE)), collapse="/"), "/", sep="")
   } else
     if (grepl("\\", OUTpath, fixed=TRUE)) { # windows style
       OUTpath<- paste(paste(unlist(strsplit(OUTpath, "\\", fixed=TRUE)), collapse="\\"), "\\", sep="")
     } else
       if(!grepl("/", OUTpath, fixed=TRUE) || !grepl("\\", OUTpath, fixed=TRUE)){
       trueFalse = FALSE
       errorMessage("Unrecognized path separator in OUTpath or no path specification in PARAMS file. Cannot open connection\n
                             You can edit your input file and save the changes. Afterwards, stop and restart glycoPipe and upload file again")
       stop("Unrecognized path separator in OUTpath\n")
     }
0
Cloud Class® Course: Certified Penetration Testing
LVL 12
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Hi

I am looking for a way to capture standard error and redirect it to standard output in R (Shiny). I can not find any information any where in the web. Is there a way to do this?  the error gets displayed to the console, but I would like to displayed in the Shiny GUI.

Thanks
0
Hi Experts,

I have a Windows 7 Home 64bit machine that wont boot in normal or safe mode....

I have pulled the drive out & backed up the data, run all tests on memory and harddrive (all ok) while I had it out I ran chkdsk /r /f  no issues found. I'm currently downloading a windows 7 disk so I can either attempt to repair from that or am  best of with a W & R? or is there something that may assist in repairing.

Windows repair from boot up does not fix it although I did come across a message about a driver missing?

The user was hacked by some one who called and he let them on his PC one thing I noticed is that windows 7 is installed on the D drive

cheers.
0
Hi,
 Although the program used to run smoothly on win98 and VB5 now cannot read the pixel info of an image (ie. jpg or gif) and therefore cannot proceed
 to calculate the Lab pixel values from RGB? In particular I have test pics of 100x100 pixel and program now reads 585x1890 !!  Any ideas?

 Following is the part of the program

 Cheers
 Public Sub Command1_Click()

 Dim OFName As OPENFILENAME
 OFName.lStructSize = Len(OFName)
 'Set the parent window
 OFName.hwndOwner = Me.hwnd
 'Set the application's instance
 OFName.hInstance = App.hInstance
 'Select a filter
 OFName.lpstrFilter = "Image Files (*.bmp;*.jpg;*.png)" + Chr$(0) + "*.bmp;*.jpg;*.png" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
 'create a buffer for the file
 OFName.lpstrFile = Space$(254)
 'set the maximum length of a returned file
 OFName.nMaxFile = 255
 'Create a buffer for the file title
 OFName.lpstrFileTitle = Space$(254)
 'Set the maximum length of a returned file title
 OFName.nMaxFileTitle = 255
 'Set the initial directory
 OFName.lpstrInitialDir = "C:\"
 'Set the title
 OFName.lpstrTitle = "Open File"
 'No flags
 OFName.flags = 0

 'Show the 'Open File'-dialog
 If GetOpenFileName(OFName) Then
 Label2 = Trim$(OFName.lpstrFile)

 End If

 End Sub

 Private Sub Command2_Click()
 Dim PicInfo As BITMAP
 Dim pic As Picture
 Dim X, Y As Long
 Dim height, width As Long
 Dim R As Long
 Dim imagesource As String
 Dim hFile As Long, FileInfo As BY_HANDLE_FILE_INFORMATION
 Dim Red, 

Open in new window

0
SQL Join Query.

I am trying to query 3 tables in a database and I am not getting the results back that I am expecting.

Here is the query:

SELECT DISTINCT m.ADName, i.FirstName, i.LastName, r.Description
FROM         Membership AS m INNER JOIN
                         user_information AS i ON m.ADName = i.NT_Username INNER JOIN
                         RolesDescription AS r ON m.RoleID = r.RoleID
WHERE     (m.ApplicationID = 6)

I think its because a record does not exist in the "User_Information" (I would like the result to show a blank field if this is the case)

I am expecting 120 records but I am getting only 106.
0
hi,

any one tried to upgrade the R ( in database) of SQL 2016 ? I have a SQL server 2016 AOG group with 3 x nodes SQL nodes one by one and only one has R (In database) service can't upgrade, any idea?
0
Hi

So if I manually connect using sftp from a centos box to my Proftpd server and issue a get command to grab a file, all's good.

If I do it in a script, it fails after getting the file  (next step would be to delete the file which it never does)

It's driving me round the bend abit, so any help would be greatly appreciated.

on the sftp client side
Log from Scripted version
2018-03-15 12:34:35,029 [30711] <sftp:6>: received READ (5) SFTP request (request ID 11, channel ID 0)
2018-03-15 12:34:35,030 [30711] <sftp:7>: received request: READ 8fc9867310df242f 0 32768
2018-03-15 12:34:35,030 [30711] <sftp:8>: sending response: STATUS 1 'End of file' ('End of file' [-1])
2018-03-15 12:34:35,030 [30711] <ssh2:9>: sending CHANNEL_DATA (remote channel ID 0, 37 data bytes)
2018-03-15 12:34:35,030 [30711] <ssh2:19>: waiting for max of 600 secs while polling socket 1 using select(2)
2018-03-15 12:34:35,030 [30711] <ssh2:3>: sent SSH_MSG_CHANNEL_DATA (94) packet (80 bytes)
2018-03-15 12:34:35,031 [30711] <ssh2:11>: channel ID 0 remote window size currently at 2096633 bytes
2018-03-15 12:34:35,031 [30711] <ssh2:19>: waiting for max of 600 secs while polling socket 0 using select(2)
2018-03-15 12:34:35,031 [30711] <ssh2:20>: SSH2 packet len = 44 bytes
2018-03-15 12:34:35,031 [30711] <ssh2:20>: SSH2 packet padding len = 5 bytes
2018-03-15 12:34:35,031 [30711] <ssh2:20>: SSH2 packet payload len = 38 bytes
2018-03-15 12:34:35,031 [30711] <ssh2:19>: waiting for max of …
0

Statistical Packages

110

Solutions

269

Contributors

Statistical packages are software titles, such as JMP and GNU Octave, and programming languages, such as MATLAB, R and SAS, that are used to discover, explore and analyze data and suggest useful conclusions, either to learn something unexpected or to confirm a hypothesis. The field includes the design and analysis of techniques to give approximate but accurate solutions to hard problems in statistics, econometrics, time-series, optimization and 2D- and 3D-visualization. Data analysis has multiple facets and approaches, encompassing diverse techniques under a variety of names, in different business, science, and social science domains.

Top Experts In
Statistical Packages
<
Monthly
>